Opened 3 years ago
Last modified 3 years ago
#17559 new enhancement
Dedicated DateTime-editing control
Reported by: | jadedctrl | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Interface Kit | Version: | R1/beta3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Adding general DateTime-editing controls to the API might be nice— it'd be useful at least for the Calendar program. Splitting off Preferences/Date & Time's TDateEdit and TTimeEdit controls would be one way of going about it, since they're nice to deal with.
Change History (6)
comment:1 by , 3 years ago
comment:2 by , 3 years ago
The deskbar way of doing it is actually a lot nicer! Maybe exposing its CalendarMenuWindow would be a good idea? A way to balance the two could be an optional button to display the pop-up next to the Date & Time-style input. Calendar right now does something similar, and it feels pretty intuitive to me.
For now, I'll just start splitting TDateEdit and TTimeEdit.
comment:3 by , 3 years ago
On that note, Calendar apparently uses a near-identical copy of CalendarMenuWindow already, haha.
comment:4 by , 3 years ago
I think it was based on it or copied, keep in mind that the control is a big buggy if you select some dates (e.g if you select the first of the next month and click the next month button it will skip ahead two months, and do nothing on the back month button) (https://dev.haiku-os.org/ticket/15397)
Anyway, I wanted to add that webkit has a way to have a native date picker aswell, so this may be usefull to add to the webkit port later on.
comment:5 by , 3 years ago
The date picker in WebKit is already implemented, using BCalendarView. It works similarly to the one in Deskbar. I think they already share most of their code.
comment:6 by , 3 years ago
Had a go at separating DateTimeEdit into libshared (https://review.haiku-os.org/c/haiku/+/4927), and fixed a couple bugs with it: Dates/Times with trailing zeroes can now be input (10, 20), and month days won't overflow (e.g., changing the date from March 31 to February 31 will correct to February 28).
Yes, if you need these in another app, move them to libshared and to the BPrivate namespace.
I wouldn't say they are that nice to use from an UX point of view, but it's possibly a reasonable start. I find the way it's done in the Deskbar clock a bit better for dates: there is a calendar and "spinners" above it to switch to different months and years. To select a day you just click on it in the calendar.