Fix execution window sorting for non-English locales and use user's date format preference#758
Conversation
Co-authored-by: chrismaddalena <10526228+chrismaddalena@users.noreply.github.com>
Co-authored-by: chrismaddalena <10526228+chrismaddalena@users.noreply.github.com>
|
@copilot This has resolved the issue. Now that we don't need to worry about the date representation affecting sorting, we should not need to enforce that all dates appear in the |
Co-authored-by: chrismaddalena <10526228+chrismaddalena@users.noreply.github.com>
Changed all date filters from |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #758 +/- ##
=======================================
Coverage 92.38% 92.39%
=======================================
Files 342 342
Lines 19771 19779 +8
=======================================
+ Hits 18266 18274 +8
Misses 1505 1505 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Identify the Bug
Fixes #194, #193, #282
Description of the Change
TableSorter's
sorter-date-range-dMMMyyyyparser only recognizes English month abbreviations. When dates render in German ("Mai") or French ("Déc"), parsing fails and sorting degrades to alphabetic ordering, breaking chronological sort.Added
data-textattributes with ISO 8601 dates to execution window cells. TableSorter readsdata-textfirst (via itstextAttributeconfig), enabling locale-independent sorting. Additionally, changed date display format from hardcoded"d M Y"to"DATE_FORMAT"to respect user's configured date format preference.Changed:
data-text="{{ *.start_date|date:"Y-m-d" }}"to date range cells and changed display format from|date:"d M Y"to|date:"DATE_FORMAT"Example:
Users see dates in their configured format (e.g., "May 1, 2022" for US English or "1. Mai 2022" for German), while TableSorter sorts by "2022-05-01".
Alternate Designs
Possible Drawbacks
None identified. Changes are additive and leverage existing TableSorter functionality while respecting user preferences.
Verification Process
data-textattribute presence with correct ISO formatManual testing requires:
LANGUAGE_CODE = 'de'in Django settings/rolodex/projects/Release Notes
Fixed execution window sorting for non-English locales and dates now respect user's configured date format preference
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.