Skip to content

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

Open
jsheffie wants to merge 20 commits into
silentsokolov:masterfrom
jsheffie:jds-fix-placeholder-for-time
Open

fix: properly display date and time placeholders for DateTimeRangeFilter#112
jsheffie wants to merge 20 commits into
silentsokolov:masterfrom
jsheffie:jds-fix-placeholder-for-time

Conversation

@jsheffie

@jsheffie jsheffie commented Jan 5, 2024

Copy link
Copy Markdown

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

codecov-commenter commented Jan 5, 2024

Copy link
Copy Markdown

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
Copy Markdown
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