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

ICU-21301 bug fix #56

Merged
merged 1 commit into from
May 22, 2024
Merged

ICU-21301 bug fix #56

merged 1 commit into from
May 22, 2024

Conversation

yoikawa
Copy link
Contributor

@yoikawa yoikawa commented May 22, 2024

Temporally fix for ICU-21301: [ICU4J] SimpleDateFormatICU.parse method returns null if the given date is the start of DST.

When ICU is enabled, and if the desired time zone supports daylight saving time, parsing transition date fails. (e.g. 9/6/2020 for "America/Santiago")

If all conditions are met, create java.text.SimipleDateFormat instance instead of SmipleDateFormatICU for parsing date/time.

@yoikawa yoikawa merged commit 3bdc924 into main May 22, 2024
4 checks passed
@yoikawa yoikawa deleted the fix-icu-date-parse branch May 22, 2024 02:14
@@ -833,8 +850,14 @@ public DateFormat getInputLongDateFormat() {
*/
public static DateFormat getLocaleInputDateFormat(Locale locale, TimeZone tz) {
DateFormat df = getFormatProvider(locale).getDateInstance(DateFormat.SHORT, locale);
// ICU-21301 hack: Apply only with an ICU object and when timezone has DST
Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to ICU-21301, this only occurs when setLenient(boolean) is set to false

yoikawa added a commit that referenced this pull request Jun 24, 2024
yoikawa added a commit that referenced this pull request Jun 25, 2024
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