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

JVM default Locale should be set to parse the datetime #9850

Closed
nusjzx opened this issue Aug 18, 2019 · 2 comments · Fixed by #9851
Closed

JVM default Locale should be set to parse the datetime #9850

nusjzx opened this issue Aug 18, 2019 · 2 comments · Fixed by #9851

Comments

@nusjzx
Copy link
Contributor

nusjzx commented Aug 18, 2019

parseInstant method in TimeHelper class is using DateTimeFormatter.ofPattern to create format pattern which uses the JVM default locale. For locale like Japan Korea, and China, it cannot parse the date time string correctly

Steps to reproduce

  1. You can either change operating system locale, which is JVM default scale, or add Locale.setDefault(Locale.CHINESE); in parseInstant method in src\main\java\teammates\common\util\TimeHelper.java
  2. start the app engine
    3.login as administrator and add instructors

Expected behaviour
should add the instructors correctly

Actual behaviour
image
image

@nusjzx
Copy link
Contributor Author

nusjzx commented Aug 19, 2019

@damithc Although there is a solution in trouble shooting, which was to change the date system default date time format. We can actually handle this configuration in code, instead of let the developer change their default settings individually.

@wkurniawan07
Copy link
Member

@nusjzx The dev troubleshooting guide is severely outdated. That aside, configuration inside code is very much preferred over tampering with dev's local machine.

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 a pull request may close this issue.

2 participants