Skip to content

Instantly share code, notes, and snippets.



Created Jul 18, 2014
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

$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() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment