| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163 |
- /* Daterangepicker bootstrap */
- $(function() {
- "use strict";
- $('#daterangepicker-example').daterangepicker();
- });
- $(function() {
- "use strict";
- $('#daterangepicker-time').daterangepicker({
- timePicker: true,
- timePickerIncrement: 30,
- format: 'MM/DD/YYYY h:mm A'
- });
- });
- $(function() {
- "use strict";
- $('#daterangepicker-custom').daterangepicker({
- startDate: moment().subtract('days', 29),
- endDate: moment(),
- minDate: '01/01/2012',
- maxDate: '12/31/2014',
- dateLimit: {
- days: 60
- },
- showDropdowns: true,
- showWeekNumbers: true,
- timePicker: false,
- timePickerIncrement: 1,
- timePicker12Hour: true,
- ranges: {
- 'Today': [moment(), moment()],
- 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
- 'Last 7 Days': [moment().subtract('days', 6), moment()],
- 'Last 30 Days': [moment().subtract('days', 29), moment()],
- 'This Month': [moment().startOf('month'), moment().endOf('month')],
- 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
- },
- opens: 'left',
- buttonClasses: ['btn btn-default'],
- applyClass: 'small bg-green',
- cancelClass: 'small ui-state-default',
- format: 'MM/DD/YYYY',
- separator: ' to ',
- locale: {
- applyLabel: 'Apply',
- fromLabel: 'From',
- toLabel: 'To',
- customRangeLabel: 'Custom Range',
- daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
- monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- firstDay: 1
- }
- },
- function(start, end) {
- console.log("Callback has been called!");
- $('#daterangepicker-custom span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
- }
- );
- $('#daterangepicker-custom span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
- });
- $(function() {
- "use strict";
- $('#daterangepicker-custom-2').daterangepicker({
- startDate: moment().subtract('days', 29),
- endDate: moment(),
- minDate: '01/01/2012',
- maxDate: '12/31/2014',
- dateLimit: {
- days: 60
- },
- showDropdowns: true,
- showWeekNumbers: true,
- timePicker: false,
- timePickerIncrement: 1,
- timePicker12Hour: true,
- ranges: {
- 'Today': [moment(), moment()],
- 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
- 'Last 7 Days': [moment().subtract('days', 6), moment()],
- 'Last 30 Days': [moment().subtract('days', 29), moment()],
- 'This Month': [moment().startOf('month'), moment().endOf('month')],
- 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
- },
- opens: 'left',
- buttonClasses: ['btn btn-default'],
- applyClass: 'small bg-green',
- cancelClass: 'small ui-state-default',
- format: 'MM/DD/YYYY',
- separator: ' to ',
- locale: {
- applyLabel: 'Apply',
- fromLabel: 'From',
- toLabel: 'To',
- customRangeLabel: 'Custom Range',
- daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
- monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- firstDay: 1
- }
- },
- function(start, end) {
- console.log("Callback has been called!");
- $('#daterangepicker-custom-2 span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
- }
- );
- $('#daterangepicker-custom-2 span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
- });
- $(function() {
- "use strict";
- $('#daterangepicker-custom-1').daterangepicker({
- startDate: moment().subtract('days', 29),
- endDate: moment(),
- minDate: '01/01/2012',
- maxDate: '12/31/2014',
- dateLimit: {
- days: 60
- },
- showDropdowns: true,
- showWeekNumbers: true,
- timePicker: false,
- timePickerIncrement: 1,
- timePicker12Hour: true,
- ranges: {
- 'Today': [moment(), moment()],
- 'Yesterday': [moment().subtract('days', 1), moment().subtract('days', 1)],
- 'Last 7 Days': [moment().subtract('days', 6), moment()],
- 'Last 30 Days': [moment().subtract('days', 29), moment()],
- 'This Month': [moment().startOf('month'), moment().endOf('month')],
- 'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
- },
- opens: 'left',
- buttonClasses: ['btn btn-default'],
- applyClass: 'small bg-green',
- cancelClass: 'small ui-state-default',
- format: 'MM/DD/YYYY',
- separator: ' to ',
- locale: {
- applyLabel: 'Apply',
- fromLabel: 'From',
- toLabel: 'To',
- customRangeLabel: 'Custom Range',
- daysOfWeek: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
- monthNames: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- firstDay: 1
- }
- },
- function(start, end) {
- console.log("Callback has been called!");
- $('#daterangepicker-custom-1 span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
- }
- );
- $('#daterangepicker-custom-1 span').html(moment().subtract('days', 29).format('MMMM D, YYYY') + ' - ' + moment().format('MMMM D, YYYY'));
- });
|