bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 574 forks source link

Add possibility to use `type="date"` from HTML 5 #559

Open thiago-negri opened 7 years ago

thiago-negri commented 7 years ago

I'd like to use input type="date" from HTML 5 instead of jQuery UI Datepicker, and fallback to jQuery UI Datepicker, like so:

$(document).on('turbolinks:load', function() {
  if ($('[type="date"]').prop('type') != 'date') {
    $('[type="date"]').datepicker();
  }
});