I am very close to release my writers app as beta, but I really would like to fix this problem first: The DesktopDateTimePicker does not allow me to change the year by simple typing; it keeps on deleting the first digits. Here is a short clip to show what I mean; there is no code in this object because I wanted to be sure that it was not because of code, but even a new object does this:
What part is the year ?
(2004 ? 2001 ? or 1904, 1901 or…)
1843, the first part.
Not many clues to guess what could be going on… macOS version? Xojo release? code involved?
Locale involved?
How do you handle the DesktopDateTimePicker to show the date as SQLDate (YYYY-MM-DD)?
Maybe the Picker was not tested/designed for that and is deleting the first digits for the year as is programmed to see days/months there?
Edit: as Rick said, what Locale are you using?
Yep, that may be the issue in that particular case.
The control gets the date / time format the user sets in the macOS preferences… what means that, by default, it uses the string format provided for a particular language or any other specifically set by the user.
Hi @AlbertoD
As you can see in the Gif… in that particular case it is getting the format from the Spanish locale: Day / Month / Year (also used in other countries, of course)
Getting/setting locales and input masks of DateTimePickers are desirable features (to override defaults for any dev reasons).
I’m talking about André’s video:
clearly is SQLDate format: YYYY-MM-DD
Can you test that? I don’t know how André managed to make DesktopDateTimePicker to show like that but maybe you do (or we can wait for André’s answer).
There is no code in this object, because I wanted to see if the problem was the code, I am in sweden but use the English format, YYYY, MM, DD.
You mean that there should only months and days showing in the Picker and no year? Not sure what the point of that would be, but also, if that’s the case, why does it show that format in my Picker if it cannot handle it?
Correct, and that Picker will change if the user has USA locale or Mexico locale.
We are trying to see why you have this problem.
I changed my settings to:
The IDE shows:
When I run I see:
When I change the year I get:
So I’m sorry I can’t reproduce your problem.
Not at all.
What I’m saying is that your locale will show 2024-02-01 for today’s date, someone in the USA will see (on the same control) 2/1/2024 and someone in Mexico running your program will see 1/2/2024.
Hope this helps.
My system settings for date and time are this:
The IDE shows:
Should the Picker automatically take on this format? I cannot change it myself as far I know.
That happens automatically, I am not able to make it show anything else.
These are my settings, which are the same as how it is displayed in Xojo, so it should work correctly. Still, it doesn’t:
Correct, that’s why Rick said:
is a feature not in the control.
I changed the Region to Sweden and now the IDE also shows the date as 2024-02-01, but still can’t reproduce the problem.
Can you create a new project with only a DesktopDateTimePicker, run it and try to change the year, does that work?