Is there a alternative for that because Firefox and Internet Explorer are not supporting it...
Example:
I ran across this while looking for something to use instead of datetime-local
https://www.daterangepicker.com/
It has similar functionality to datetime-local
and some extra. The one thing you would have to account for is being able to limit users' changing the date values in the input box if you do it that way. datetime-local
automatically prevents say, putting letters into the time values.
Otherwise, Jonathan's answer still seems the best basic built-in option that works with FF/Chrome.
You can use <input type="date"> <input type="time">
together. Personally I think this is why datetime-local was removed. There are some great polyfills as well, like this one: http://afarkas.github.io/webshim/demos/index.html
In my case, I tried many things but nothing looks perfect, finally, I came with this walk around to split the datetime into two inline inputs and remove the border between them to looks like just one input variable:
<form action="" class="form-inline">
<div class="form-group">
<input class="form-control" style=" border-right-style: none" type="date" max="9999-12-12T00:00:00.00" />
</div>
<div class="form-group">
<input class="form-control" style=" border-left-style: none" type="time" max="9999-12-12T00:00:00.00" />
</div>
By my side I'm using a class (datetime-local) on all the inputs with type datetime-local. Then I can replace all these inputs by a custome version: CalendarPopup (https://xdsoft.net/jqplugins/calendar-popup/)
var calendar = $('input.datetime-local').CalendarPopup();