egui
egui copied to clipboard
Changed datepicker widget from egui_extras to use DateTime
Chrono crate advises not to use Date type, and, to discourage to use it, that type is non serializable with serde. Since persistence feature of eframe requires serde, is is impossible to make datepicker state persistent without conversions. Switching Date type to Datetime fixes that issue.
Whilst I agree that attaching time to explicit date functionality is not perfect, I'd strongly shy away from any custom Date type. The cleanest choice might be to extend the widget to include time (and default to zero time as in the pull), and adopt the ecosystem time standard. I found this pull looking for a date time picker widget!
Chrono API documentation recommends using NaiveDate
instead of Date
, which would make sense here since the datepicker widget is time zone agnostic.
NaiveDate
implements serde::Serialize
, it is also directly supported by ORMs like Diesel.