vascofg / react-admin-date-inputs

Date Inputs for react-admin
MIT License
67 stars 81 forks source link

Internal value for DatePicker has inconsistent time component #6

Closed jarradsl closed 6 years ago

jarradsl commented 6 years ago

Not sure if this is a problem in your component or upstream library but there is inconsistency in DatePicker value behavior.

When setting a value from none to the "Today"/highlighted date, the value becomes a Date with current time components (hours, minutes, seconds). When setting a value to an explicit date (past/future) the value becomes the Date without time component (hours/minutes/seconds = 0/0/0).

My opinion is that time components should be 0 when only using DatePicker (aka midnight of the date selected).

vascofg commented 6 years ago

This package only wraps the material-ui-pickers components so you should report this there.

On Thu, 5 Jul 2018, 20:05 Jarrad, notifications@github.com wrote:

Not sure if this is a problem in your component or upstream library but there is inconsistency in DatePicker value behavior.

When setting a value from none to the "Today"/highlighted date, the value becomes a Date with current time components (hours, minutes, seconds). When setting a value to an explicit date (past/future) the value becomes the Date without time component (hours/minutes/seconds = 0/0/0).

My opinion is that time components should be 0 when only using DatePicker (aka midnight of the date selected).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/vascofg/react-admin-date-inputs/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AAmuSRrq0m1BgiXfd0jPyD20FB7qoW5mks5uDmNbgaJpZM4VEZDf .

jarradsl commented 5 years ago

Created https://github.com/dmtrKovalenko/material-ui-pickers/issues/697