Skip to content

Conversation

@bjorkert
Copy link
Contributor

Overview

This PR addresses a bug where the date parsing in NightscoutUtils fails when the device is set to a 12-hour time format. The issue stems from the DateFormatter not being explicitly set to a locale that supports 24-hour time formats, which can lead to inconsistencies based on the user's device settings.

Changes

  • Set the locale of dateFormatterWithMilliseconds and dateFormatterWithoutMilliseconds in NightscoutUtils.parseDate to en_US_POSIX. This locale is designed for machine-readable strings and ensures that the date parsing behavior is consistent, regardless of the user's regional and time format settings.

@bjorkert bjorkert requested a review from marionbarker March 28, 2024 17:16
@marionbarker marionbarker merged commit cd66a28 into dev Mar 29, 2024
@marionbarker marionbarker deleted the date-parsing-issue branch March 29, 2024 20:41
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.

3 participants