Skip to content

Use a fixed locale for timestamp conversion#7

Merged
clarlars merged 1 commit intoodk-x:masterfrom
linl33:timestamp-locale
Mar 31, 2018
Merged

Use a fixed locale for timestamp conversion#7
clarlars merged 1 commit intoodk-x:masterfrom
linl33:timestamp-locale

Conversation

@linl33
Copy link
Member

@linl33 linl33 commented Mar 17, 2018

When a locale is not specified, SimpleDateFormat uses the system's default locale. This causes problem when the locale expresses time differently from how time is expressed in English.

The problem was brought to attention when a user reported on the forum that Survey couldn't display datetime nor save changes when the system locale is set to Arabic.

This PR adds overloaded methods for milliSecondsFromNanos and milliSecondsFromNanos that accept a locale. The 2 original methods (now marked Deprecated) maintain the original behavior for backwards compatibility.

@linl33 linl33 requested a review from wbrunette March 17, 2018 17:58
@linl33 linl33 force-pushed the timestamp-locale branch 3 times, most recently from 15b3bc0 to 0d37649 Compare March 30, 2018 21:10
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