This repository was archived by the owner on Apr 12, 2024. It is now read-only.
fix(date): date filter now correctly formats high precision date-times #2280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix the date filter so fractional seconds are processed correctly. For example
{{2003-09-10T13:02:03.987654Z | date: yyyy-mm-dd ss}}
is now formatted as2003-09-10 03
. Prior to this fix it was formatted as2003-09-10 30
because the code treated.987654
as 987.654s / 60s = 16 minutes 27.654 seconds so 27 seconds were added to the second component of the date.The fractional seconds are rounded to the nearest millisecond.
I've also fixed a couple of tests so they work correctly when they are run in any time zone. I tested them in UTC+1300.
See: