Skip to content

Commit 2d0be54

Browse files
committed
Add "last month"/"this month" options in date range field.
1 parent 9047af1 commit 2d0be54

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

main/inc/lib/formvalidator/Element/DateRangePicker.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ private function getElementJS()
172172
$minDate
173173
ranges: {
174174
'".addslashes(get_lang('Today'))."': [moment(), moment()],
175+
'".addslashes(get_lang('Yesterday'))."': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
176+
'".addslashes(get_lang('ThisMonth'))."': [moment().startOf('month'), moment().endOf('month')],
177+
'".addslashes(get_lang('LastMonth'))."': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')],
175178
'".addslashes(get_lang('ThisWeek'))."': [moment().weekday(1), moment().weekday(5)],
176179
'".addslashes(get_lang('NextWeek'))."': [moment().weekday(8), moment().weekday(12)]
177180
},

main/lang/english/trad4all.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8137,4 +8137,6 @@
81378137
$GroupDocumentAccess = "Document access";
81388138
$DocumentGroupShareMode = "Share mode";
81398139
$SessionDurationXDaysTotal = "This session has a limited duration of %s days";
8140+
$LastMonth = "Last month";
8141+
$ThisMonth = "This month";
81408142
?>

main/lang/spanish/trad4all.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8161,4 +8161,6 @@
81618161
$GroupDocumentAccess = "Acceso a documento";
81628162
$DocumentGroupShareMode = "Modo compartido";
81638163
$SessionDurationXDaysTotal = "Esta sesión tiene una duración limitada a %s días";
8164+
$LastMonth = "Mes pasado";
8165+
$ThisMonth = "Este mes";
81648166
?>

0 commit comments

Comments
 (0)