Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG FIX] [MER-3669] date groups do not match the dates rendered on the page #5045

Merged
merged 1 commit into from
Aug 22, 2024

Conversation

eliknebel
Copy link
Contributor

https://eliterate.atlassian.net/browse/MER-3669

Fixes an issue where date groupings were not being localized causing inconsistent due dates.

When grouping pages and assignments by due dates in the module index, the grouping was being determined by a non-localized datetime -> date conversion, losing the timezone information in the process. This resulted in some dates rendering off by a day, effectively rendering the UTC date, when actually it should have matched the other dates being displayed, rendered in the localized timezone.

The fix here is to localize the datetime before converting to naive date for grouping such that date groupings accurately match the actual dates being rendered on the page.

@eliknebel eliknebel changed the title [BUG FIX] [MER-3669] dates dont align [BUG FIX] [MER-3669] date groups do not match the dates rendered on the page Aug 22, 2024
Copy link
Contributor

@gastonabella gastonabella left a comment

Choose a reason for hiding this comment

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

LGTM

@gastonabella gastonabella merged commit d783cd9 into hotfix-v0.28.4 Aug 22, 2024
7 checks passed
Copy link
Collaborator

@manelli manelli left a comment

Choose a reason for hiding this comment

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

Looks good! 🚀
Left a minor comment

)

_ ->
[]
end)
end

defp to_localized_date(datetime, ctx) do
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we can use the existing OliWeb.Common.FormatDateTime.maybe_localized_datetime/2 function?

@eliknebel eliknebel deleted the MER-3669-dates-dont-align branch August 22, 2024 19:23
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.

3 participants