My question intentionally is “Is it possible?” and not “How to?”, because I am not sure whether it is possible at all. Material UI X DatePicker API https://mui.com/x/api/date-pickers/date-picker/ shows that DatePicker value
type is object
– apparently it is standarta JS/DT Date
, which has always are time component as well and you can not just strip time from it.
But sometimes it is very important to have date only – e.g. the John Brown may start work on ‘10.04.2024’ in FR TZ and this ‘10.04.2024’ should be displayed in React web app (with DatePicker) as ‘10.04.2024’ in any TZ, any browser. But, if Date object is used, then it may be possible that from the US-located computers DatePicker sees the browser TZ and displays ‘10.04.2024 FR’ as ‘09.04.2024’ that is quite confusing, as clients know that John Brown works in FR branch and all the legal data about him should be displayed keeping in mind that they refere to the FR legal system.
So – maybe there is ‘pure date option’ for DatePicker where can I pass just date string ‘DD-MM-YYYY’ and the DatePicker displays this date exactly as such without assuming that it is DD-MM-YYYY-UTC-MIDNIGHT? Date
object always have time. strings may go with just date data?