Skip to content

Instantly share code, notes, and snippets.

@mischah

mischah/README.md

Created Jul 18, 2014
Embed
What would you like to do?
The power of moment.js

#The power of Moment.js

Use case:

  • start date: current day + 2 days
  • end date: current day + 7 days
  • default date: current day + 2 days
  • disabled dates: Sundays within the range of start date to end date

http://momentjs.com

$form.find('#deliveryDate').datetimepicker($.extend(amsel.base.getDatetimepickerDefaults(), {
startDate: moment().add('days', 2),
endDate: moment().add('days', 7),
defaultDate: moment().add('days', 2),
disabledDates: [moment().day(7)],
})).on('change.dp', function() {
$(this).trigger('blur');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.