Skip to content

fix: display download email date ranges in UTC - #330

Merged
utas-raymondng merged 6 commits into
mainfrom
bugfix/9062-email-date-range-utc
Aug 21, 2026
Merged

fix: display download email date ranges in UTC#330
utas-raymondng merged 6 commits into
mainfrom
bugfix/9062-email-date-range-utc

Conversation

@grojeda

@grojeda grojeda commented Aug 20, 2026

Copy link
Copy Markdown
Contributor
image

@utas-raymondng utas-raymondng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it is easier to use -Duser.timezone=UTC to force the java app to assume UTC, so we do not need to change code to handle it? That said we still need to update the display format

This is control by the github/aodn/appDeploy project, i can show you with Zoom

try {
return !java.time.LocalDate.parse(date.trim(), ISO_DATE_FORMAT).isBefore(java.time.LocalDate.now());
} catch (java.time.format.DateTimeParseException e) {
return !LocalDate.parse(date.trim(), ISO_DATE_FORMAT).isBefore(LocalDate.now(ZoneOffset.UTC));

@utas-raymondng utas-raymondng Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not correct if timezone is use in this case when machine is running in Mel (ap-southeast). Lets say

  1. If your input date is Friday's date (local Australian time), LocalDate.parse() treats it as Friday and UTC
  2. LocalDate.now(ZoneOffset.UTC) will say it is Thursday.
  3. For several hours every morning in Australia, local "today" will not match UTC "today"

@utas-raymondng utas-raymondng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment

);

assertTrue(result.contains("05 Jan 2024 - 31 Dec 2024"), "Expected dd MMM yyyy date format");
void testDatesShowInclusiveUtcRangeInNonUtcServerTimezone() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test needed or should be replace by test that check system time is UTC by default?

@utas-raymondng utas-raymondng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@utas-raymondng
utas-raymondng merged commit 9068d1e into main Aug 21, 2026
4 checks passed
@utas-raymondng
utas-raymondng deleted the bugfix/9062-email-date-range-utc branch August 21, 2026 01:19
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.

2 participants