For setting a birthdate I wouldn’t even bother with the graphical variant and stick with the simple version. It’s the fastest for this kind of tasks. The graphical version is suitable for scheduling meetings and such, i.e. selecting dates close to the current date (or another set date). But I wouldn’t use it for selecting some arbitrary date in the (possibly distant) past or future.
The graphical picker is also useful whenever the day of the week is relevant (like for meetings). But your birthdate is what it is and you’ve got no choice anyway.
It is likely worth adding a bug report for the lack of setting a year in any useful way.
You, could, as a work around add a context menu that would list the years between MinimumDate and MaximumDate. Then you could change the date by right clicking on the control.
Online versions of the “graphical control” typically allow you to click on the year and a popup opens to allow you to select Month and Year. You could rig this up by using MouseDown / MouseUp within the top left area of the control and the new popup window option.
That is the ‘native’ macOS control.
On Windows there is a better native control.
We already talked about this in another thread where Emile asked the same thing (changing the year for a birthday date).
Xojo favors native controls I don’t think they will change what macOS offers.
Can you tell me of anything that uses that control for setting date. It used to be used by macOS settings but that only uses the non-graphical version in the latest version. I’m just interested to see what Apple have done about year when they are using it. Skipping month by month is super tedious.
Hmm… that’s interesting. The Xojo control doesn’t pop the graphical version up when you click in the non-graphical version. You could probably rig one with a popup window.
In code you mean? You can set it to any date you like, including the year:
DateTimePicker1.SelectedDate = new DateTime(1959, 3, 5)
With the non-graphical variant of the DateTimePicker the user can simply type in any desired year (or day or month). What’s the problem you are trying to solve?
If you absolutely must use the graphical version for birthdates (which I wouldn’t, for the reasons explained above) you could combine it with the non-graphical picker and synchronize the two (like I’ve suggested a few weeks ago).
That where I was, when I stopped (forgot why; boring, maybe).
I may use a simple ask for a date (DD-MM-YYYY), pass the result to a DateTime at OK time and accept if the Date is valid / tell the user to retype the date otherwise…
With Xojo’s DateTimePicker (non-graphical style) the user could also type in day, month, and year, and it would be guaranteed you’d get a valid DateTime. Entering an invalid date would be impossible – no need to check the date in code.