Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Add default range options for date range picker

givanzf969591b76ee
diff --git a/public/js/admin/functions.js b/public/js/admin/functions.js
index 4da3726..08dd3ce 100644
--- a/public/js/admin/functions.js
+++ b/public/js/admin/functions.js
@@ -217,13 +217,19 @@ let daterangepicker = function (e) {
new DateRangePicker(element, {
singleDatePicker: false,
autoApply: true,
+ //opens: 'left',
//autoUpdateInput: false,
+ ranges: {
+ 'Today': [moment().startOf('day'), moment().endOf('day')],
+ 'Yesterday': [moment().subtract(1, 'days').startOf('day'), moment().subtract(1, 'days').endOf('day')],
+ 'Last 7 Days': [moment().subtract(6, 'days').startOf('day'), moment().endOf('day')],
+ 'This Month': [moment().startOf('month').startOf('day'), moment().endOf('month').endOf('day')],
+ 'This Year': [moment().startOf('year').startOf('month').startOf('day'), moment().endOf('year').endOf('month').endOf('day')],
+ },
locale: {
- format: 'YYYY-MM-DD'
+ format: "YYYY-MM-DD",
}
- }/*, function (start, end) {
- this.element.value = start.format('YYYY-MM-DD') + " - " + end.format('YYYY-MM-DD');
- }*/);
+ });
}
}