Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: properly display date and time placeholders for DateTimeRangeFilter #112

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

jsheffie
Copy link

@jsheffie jsheffie commented Jan 5, 2024

closes: #113

Changes:

  • Brought in contrib/admin/widgets.py:AdminSplitDateTime and made two changes:
    • modified init to accept date_attrs and time_attrs and pass them down to the subwidgets.
    • don't pass args to this init call forms.MultiWidget.__init__(self, widgets)

Status:
Alright, this is working for Django 4.2 and above.
I am currently trying to figure out how to make this work on older versions of django.

Visualize

📸 Before: displays 'date' in the time fields

Screenshot 2024-01-05 at 9 58 43 AM

📸 After: displays 'time' in the time fields

Screenshot 2024-01-05 at 9 55 58 AM

@codecov-commenter
Copy link

codecov-commenter commented Jan 5, 2024

Codecov Report

Attention: Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.

Project coverage is 86.70%. Comparing base (b4f6c29) to head (01ffef8).
Report is 17 commits behind head on master.

Files with missing lines Patch % Lines
rangefilter/filters.py 57.14% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
- Coverage   87.45%   86.70%   -0.75%     
==========================================
  Files           9        9              
  Lines         606      617      +11     
==========================================
+ Hits          530      535       +5     
- Misses         76       82       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jsheffie jsheffie marked this pull request as draft January 5, 2024 16:33
@jsheffie jsheffie marked this pull request as ready for review January 5, 2024 16:43
@silentsokolov
Copy link
Owner

Look nice! Thanks you!
I think it will take more time for testing to ensure there are no critical errors on older versions. After fix current tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DateTimeRangeFilter shows placeholder text 'date' in the time filters
3 participants