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

Fix Utils.toIsoDateFormat() for non-English locales. #116

Merged
merged 1 commit into from
May 4, 2016

Conversation

kaitoy
Copy link

@kaitoy kaitoy commented Apr 30, 2016

When a user set bintray.pkg.version.released to a Date instance, its string representation will be passed to toIsoDateFormat() and parsed by the dateToStringFormat.
But in non-English locales such as Japanese, this parse fails because a Date instance is always converted to an English string but a SimpleDateFormat object instantiated without specifying a locale attempts to parse a given string in the JVM locale (i.e. non-English), which results in an error like "java.text.ParseException: Unparseable date: "Fri Apr 29 10:03:11 MDT 2016"".
To avoid this error, Locale.English is added to SimpleDateFormat's constructor.

@eyalbe4
Copy link
Contributor

eyalbe4 commented May 1, 2016

Thank you for this @kaitoy!
Can you please sign JFrog's CLA so that we can merge this?

@kaitoy
Copy link
Author

kaitoy commented May 1, 2016

I've signed it.

@eyalbe4 eyalbe4 merged commit e3e70e6 into bintray:master May 4, 2016
@eyalbe4
Copy link
Contributor

eyalbe4 commented Jun 22, 2016

@kaitoy, release 1.7 includes your fix. Thanks.

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