Skip to content

Conversation

@cwarden
Copy link
Contributor

@cwarden cwarden commented Jan 1, 2026

  • startOfThisCalendarQuarter(): Use Date instead of Datetime to avoid timezone issues when calling .month() (Date.month() returns the date's month directly, while Datetime.month() returns the month in the user's local timezone)

  • startOfthisFiscalQuarter(): Change < to <= in while loop to correctly handle quarter boundaries when today is the first day of a quarter

- startOfThisCalendarQuarter(): Use Date instead of Datetime to avoid
  timezone issues when calling .month() (Date.month() returns the date's
  month directly, while Datetime.month() returns the month in the user's
  local timezone)

- startOfthisFiscalQuarter(): Change < to <= in while loop to correctly
  handle quarter boundaries when today is the first day of a quarter
@cwarden
Copy link
Contributor Author

cwarden commented Jan 1, 2026

Today is January 1, 2026. Without the fixes:

$ aer exec 'System.debug(GMT.startOfthisFiscalQuarter()); System.debug(GMT.startOfThisCalendarQuarter());' -p moxygen/
2025-10-01 00:00:00
2025-10-01 00:00:00 +0000 UTC

With the fixes:

$ aer exec 'System.debug(GMT.startOfthisFiscalQuarter()); System.debug(GMT.startOfThisCalendarQuarter());' -p moxygen/
2026-01-01 00:00:00
2026-01-01 00:00:00 +0000 UTC

@ZackFra ZackFra merged commit 7169fd1 into ZackFra:main Jan 4, 2026
16 of 19 checks passed
@ZackFra
Copy link
Owner

ZackFra commented Jan 4, 2026

Appreciate it! I saw the unit tests fail on the 1st and figured it was a date/time issue - glad to see someone else was already on it! Just pushed this forward.

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