Skip to content

Instantly share code, notes, and snippets.

<script>
// For date/time picker +1 day after certain time
// https://gist.github.com/carmoreira/3ebf05aa9e31f8ddba3af8e3408ceab6 (plugin author)
jQuery(document).ready(function(){
// get current time with moment - it will have the tz
var date = moment().toDate();
var closetime = moment('18:00','HH:mm').toDate();
// if it's after X pm (24 hr format) then change classes and re-init date pickers
if(date >= closetime){
jQuery('.datefield-ny').removeClass('datefield-ny').addClass('datefield-ny-plus-one');