django-admin-rangefilter icon indicating copy to clipboard operation
django-admin-rangefilter copied to clipboard

fix: properly display date and time placeholders for DateTimeRangeFilter

Open jsheffie opened this issue 2 years ago • 2 comments

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

jsheffie avatar Jan 05 '24 04:01 jsheffie

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 15 commits behind head on master.

Files Patch % Lines
rangefilter/filters.py 57.14% 6 Missing :warning:
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     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 05 '24 04:01 codecov-commenter

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

silentsokolov avatar Jan 06 '24 05:01 silentsokolov