JSFiddle - React, Tailwind, and code Playground

by Tintu Raju

HTML

<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js"></script>
<input type="date">
<input type="date">
<input type="date">

JavaScript

$(document).ready(function() {
    if (!Modernizr.inputtypes.date || $(window).width() >= 900) {
        $('input[type=date]').attr("type","text").addClass("myHack").datepicker();
    }
});

$(window).resize(function() {
    if (!Modernizr.inputtypes.date || $(window).width() >= 900) {
        $('input[type=date]').attr("type","text").addClass("myHack").datepicker();             
    }
    else {
        $('.myHack').attr("type","date").datepicker("destroy");
    }
});