Skip to content

Compare Parsed Dates As Strings In Date And Datetime Tests - #9

Open
cwarden wants to merge 1 commit into
open-force:mainfrom
cwarden:buddhist-era-fix
Open

cwarden wants to merge 1 commit into
open-force:mainfrom
cwarden:buddhist-era-fix

Conversation

@cwarden

@cwarden cwarden commented Nov 11, 2026

Copy link
Copy Markdown

testGetDateValue and testGetDatetimeValue compared the parsed values with values built by Date.newInstance and Datetime.newInstanceGmt. Those constructors read the year in the running user's calendar: for a th_TH user, Date.newInstance(2011, 3, 22) is 1468-03-22, while Date.valueOf and Datetime.valueOfGmt keep the year written in the ISO string, so both tests failed for a user with the Thai locale.

Compare the GMT string form of each parsed value with the expected date and time instead, so the tests pass for a user in any locale.

testGetDateValue and testGetDatetimeValue compared the parsed values with
values built by Date.newInstance and Datetime.newInstanceGmt. Those
constructors read the year in the running user's calendar: for a th_TH user,
Date.newInstance(2011, 3, 22) is 1468-03-22, while Date.valueOf and
Datetime.valueOfGmt keep the year written in the ISO string, so both tests
failed for a user with the Thai locale.

Compare the GMT string form of each parsed value with the expected date and
time instead, so the tests pass for a user in any locale.
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.

1 participant