Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5042 +/- ##
============================================
- Coverage 7.84% 7.84% -0.01%
Complexity 876 876
============================================
Files 624 624
Lines 42815 42818 +3
Branches 10375 10376 +1
============================================
Hits 3357 3357
- Misses 38955 38958 +3
Partials 503 503 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| TimeZone tz = session.timezone | ||
| if (tz != null) { | ||
| df.setTimeZone(tz) | ||
| } |
There was a problem hiding this comment.
This changes the default behaviour whenever we call <format:date /> with a format that includes the date (not just time).
Did you test how this behaves for dates that don't have a time component such as expiration date?
For example, this one from outgoing/inbound transfers:
<format:date obj="${inventoryItem.expirationDate }"/>
My worry is that despite expiration date not being a precise moment in time (it's just a date), it is still stored as a full datetime object. If we have an expiration date of Jan 1st, 2025, it would be stored as 2025-01-01 00:00:00 UTC. This means if we convert the date to UTC-1 it'll show up as 2024-12-31 23:00:00 UTC-1, which will get formatted as 31/Dec/2024. So depending on where you are, expiration date is different, which I doubt is what we want.
This is a big reason why I wanted to switch to java.time instead. If the field was a LocalDate (instead of Date) it wouldn't be an issue. Date should only be used for precise exact moments in time.
You can test it out to see if my hunch is correct. If so, we'd probably need to do something silly here like check if the date is at midnight and if so, don't timezone convert, but that's not perfect either because we wouldn't be able to represent full datetimes that happen to occur at midnight.
|
I'm going to close this PR since we've implemented a solution in #5474 The |
This PR attempts to fix a bug (#5038) we noticed recently while performing a discovery on migrating our datetime dependencies from java.util to java.time.
Note: We'll end up consolidating the logic around displaying datetimes later. This is just to fix an annoying bug as unobtrusively as possible.