Skip to content

Instantly share code, notes, and snippets.

@guilleferrer
Last active December 16, 2015 14:58
Show Gist options
  • Save guilleferrer/5452023 to your computer and use it in GitHub Desktop.
Save guilleferrer/5452023 to your computer and use it in GitHub Desktop.
ranges: {
'Today': ['today', 'today'],
'Yesterday': ['yesterday', 'yesterday'],
'Last 7 Days': [Date.today().add({
days: -6
}), 'today'],
'Last 30 Days': [Date.today().add({
days: -29
}), 'today'],
'This Month': [Date.today().moveToFirstDayOfMonth(), Date.today().moveToLastDayOfMonth()],
'Last Month': [Date.today().moveToFirstDayOfMonth().add({
months: -1
}), Date.today().moveToFirstDayOfMonth().add({
days: -1
})]
},
/*
Para usar los ranges por defecto,
sólo hay que “Activar los ranges”, pasando la opción “showRanges : true”
*/
$('#datepicker-calendar').DatePicker({
inline: true,
date: [from, to],
calendars: 3,
mode: 'range',
starts: 1,
showRanges: true,
textField : '#date-range-field',
onApply: function () {
ToggleInput();
}
});
$('#datepicker-calendar').DatePicker({
inline: true,
date: [from, to],
calendars: 3,
mode: 'range',
starts: 1,
showRanges: true,
textField : '#date-range-field',
onApply: function () {
ToggleInput();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment