-
Notifications
You must be signed in to change notification settings - Fork 10
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
24h mode property not ok? #22
Comments
When I started this project I didn't really pay attention to people switching live in code from 12 to 24 --> I only added this on the UI demo as a courtesy for demoing only. It is undefined on how the behavior works from converting 12 <--> 24 in code. Is this of value for you in your software? I can add this feature properly if so. |
I try to make an application that is used in the US and Germany at the same time. For now I have my own conversation of the time formats, but it'll be shorter and cleaner to have this directly from the chooser... |
Thanks for the feedback - I will start a sprint to add/fix this behavior. |
Dates, and DateTimes, dont have a notion of the "representation" |
Something like the following will format the date using a german locale (one that uses 24 hr form in writing)
|
This is the way I'm calling the Picker:
MyPicker.drawColSeperatorLines = True
MyPicker.LocalizationInt = 6
MyPicker.StartYear = DateTime.Now.Year - 3
MyPicker.EndYear = DateTime.Now.Year + 3
MyPicker.SelectedDate = DateTime.Now
MyPicker.TimeMode = 24
MyPicker.flashSeparator = False
MyPicker.Invalidate(False)
MyPicker.Show
and when I try to read the selected date/time (in the DateTimeWindow code, where I created a button with an action event) with:
ProgramWindow.chosenDate = self.SelectedDate
System.DebugLog("Datum = " + ProgramWindow.chosenDate.ToString(Locale.Current, DateTime.FormatStyles.Medium, DateTime.FormatStyles.Short))
I get the following:
Datum = 01.02.2020, 04:16
When I change the MyPicker.TimeMode to 12 it's:
Datum = 01.02.2020, 16:16
The picker itself displays the 24hour-mode correctly, but the property
.SelectedDate
does not.The text was updated successfully, but these errors were encountered: