mui/material-ui

[DatePicker] Preserve time component of Date

Closed this issue · 1 comments

at0g commented

Description

Whenever a Date is chosen in the DatePicker, it defaults the time to midnight.
While this behaviour may be desirable in some situations, it's a nuisance when trying to work with both a DatePicker and a TimePicker (seeing as there is no unified DateTimePicker).

A couple of points:

  • The Date object contains both the calendar date components along with time/tz components.
  • The DatePicker operates on the calendar date components of the Date object, it probably should not mess with the time (at the very least, this should be a configuration option)
  • The TimePicker does not reset the calendar part of the date back to 1/1/1970 when a time is chosen

Closing for #4787