How To Create An HTML Input Date & Time In React
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyDh32pa246L9s96ftvMDFcfXPhBXJb5u-D4G8W-N7a-hIjpmgQRIUQxdPJOQAZvtxrL_NWNuu_XoBwvREd88KIF1PyeAgXh4j9zEwOMFc9egwGba2fVS6Tns6ctIw9Cb_Wt20jduiZKhZ/w400-h171/Screenshot+2021-02-09+012957.jpg)
html datetime in react The thing about HTML 5 is that it does have some features that work from different browsers and the other doesn't, the obvious element that is really useful is the HTML input type datetime-local. It works perfectly on Chrome, but unfortunately doesn’t work on Firefox and Safari, if this happened only on an internet explorer or something older, i wouldn’t bother, but Firefox or safari is a major browser with a huge amount of users, so it is something that we need to support in other for our app to be function. So here’s what I came up with using a combination of HTML type date and html type time to create a single react component as a replacement of datetime-local. Here's the full example code on Code Sandbox so you can play with: FULL CODES & DEMO . The idea is just to create a combination of input date and input type which is supported by All major browsers, so there’s nothing fancy here. There’s already a react-datetime library but it doesn’t wo