Skip to content Skip to sidebar Skip to footer

Do Browsers No Longer Support Date Time Picker?

I have been searching around for a simple standard date time picker and a lot of the websites say that: Should produce a support

Solution 1:

According to W3School, this feature is not supported in Chrome, Firefox, or Internet Explorer : http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_datetime

Here's an explanation about why they removed the support : Why is HTML5 input type datetime removed from browsers already supporting it?

You can find many alternatives (using JavaScript) around the web, jQueryUI implements one : https://jqueryui.com/datepicker/

Solution 2:

I'm using Eonasdan's implementation of the datetimepicker as found here. For me, having multiple pickers per page is as simple as attaching them to different #ids on the page.

Here's what I'm using to implement four datetimepickers. The first one (job) loads existing data out of a template engine, and the second defaults to a mix of current date-level information and constant times.

$(function () {
        var d = newDate();
        var month = d.getMonth();
        var day = d.getDate();
        var year = d.getFullYear();

        $('#jobDateStart').datetimepicker({
            defaultDate: moment("{{ $data['job_info']['start_date'] }}",'m/d/Y H:i:s')
        });
        $('#jobDateEnd').datetimepicker({
            defaultDate: moment("{{ $data['job_info']['end_date'] }}",'m/d/Y H:i:s')
        });
        $('#dayDateStart').datetimepicker();
        $("#dayDateStart").data("DateTimePicker").date(newDate(year, month, day, 7, 00));
        $('#dayDateEnd').datetimepicker();
        $("#dayDateEnd").data("DateTimePicker").date(newDate(year, month, day, 17, 00));
});

Solution 3:

It looks like the input type 'datetime' isn't supported by any popular browser.

You can try

<inputtype='datetime-local'name="formStartDate">

instead. Which is supported by Chrome, Safari, and Opera, but not IE or Firefox

Source: http://www.w3schools.com/html/html_form_input_types.asp

Post a Comment for "Do Browsers No Longer Support Date Time Picker?"