TODAY I LEARNED

HTML5 Date Input doesn't work on Firefox #wtf

This one caught me by surprise today. Luckily, it's relatively simple to detect the missing functionality using Modernizr.js and use Datepickr instead.

$(function(){           
  if (!Modernizr.inputtypes.date) {
    $('input[type=date]').datepicker({
      dateFormat : 'yy-mm-dd'
    });
  }
});

http://stackoverflow.com/a/30503903/626048

Tweet

Learned by obie-fernandez on Feb 15, 2017

Discover our latest blog posts
  • #javascript
  • view raw
  • permalink
  • 2 likes
previous TIL next TIL
  • Log in
  • ?

    TIL is an open-source project by MagmaLabs that exists to catalogue the sharing & accumulation of knowledge as it happens day-to-day. Posts have a 200-word limit, and posting is open to any MagmaLaber as well as selected friends of MagmaLabs. We hope you enjoy learning along with us.

    • /wearemagmalabs
  • statistics
  • search
  • Twitter