Closed ecwu closed 2 months ago
app/models/assessment.rb (1)
`433-433`: **LGTM! But verify the function usage in the codebase.** The code changes are approved. However, ensure that all function calls to `date_to_s` correctly handle the new behavior of adjusting the date to the system's local timezone.
I was unable to recreate the issue on my end (the timezones were correct previously), but I don't see any issues with the changes provided. LGTM
Description
As described in #2169, the displayed date-time is not in the correct timezone as the system. This change convert the date object to the local time zone before formatting it into a string.
Motivation and Context
To resolve this, I adjusted the
date_to_s
method inmodels/assessment.rb
to utilize thegetlocal
method, which should fetch the system's timezone. This ensures the date and time are displayed correctly according to the system's local timezone.How Has This Been Tested?
I have tested this fix on my end with system time zone set to Asia/Shanghai, and the date and time are now displayed correctly.
Types of changes
Checklist:
overcommit --install && overcommit --sign
to use pre-commit hook for lintingOther issues / help required
If unsure, feel free to submit first and we'll help you along.