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

support for 12 hour time Locale setting (hourCycle) #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

lucianmocan
Copy link

@lucianmocan lucianmocan commented Jan 31, 2024

fixes #5
When 24-hour time (Locale.current.hourCycle is equal to .zeroToTwentyThree) is toggled ON in Settings, everything works as expected.
When 24-hour time is toggled OFF in Settings (Locale.current.hourCycle is equal to .oneToTwelve), certain Date fields (like dstart, dtend) were nil. To fix that issue, the 'formatter' in DateTimeType needs to be set up as "en_US_POSIX" if 24-hour time is OFF.

… is 12-hour (not 24-hour). If 12 hour then set locale to "en_US_POSIX" else leave it unchanged.
@lucianmocan lucianmocan changed the title fixes #5 support for 12 hour time (hourCycle) Jan 31, 2024
@lucianmocan lucianmocan changed the title support for 12 hour time (hourCycle) support for 12 hour time Locale setting (hourCycle) Jan 31, 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.

if not 24-Hour Time, dates are nil
1 participant