File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1195,11 +1195,11 @@ extract_from_to_dates()
1195
1195
{
1196
1196
case " $FROM_TO_ALIAS " in
1197
1197
week)
1198
- FROM_AT=$( date -d " $( date -d yesterday +%u) days ago" +" %Y-%m-%d" )
1198
+ FROM_AT=$( date -d " $(( $( date +% u) - 1 ) ) days ago" +" %Y-%m-%d" )
1199
1199
TO_AT=$( date -d " $FROM_AT + 6 days" +" %Y-%m-%d" )
1200
1200
;;
1201
1201
previous-week)
1202
- local first_date_of_current_week=$( date -d " $( date -d yesterday +%u) days ago" +" %Y-%m-%d" )
1202
+ local first_date_of_current_week=$( date -d " $(( $( date +% u) - 1 ) ) days ago" +" %Y-%m-%d" )
1203
1203
FROM_AT=$( date -d " $first_date_of_current_week -7 days" +" %Y-%m-%d" )
1204
1204
TO_AT=$( date -d " $first_date_of_current_week -1 days" +" %Y-%m-%d" )
1205
1205
;;
@@ -1212,8 +1212,8 @@ extract_from_to_dates()
1212
1212
TO_AT=$( date -d " $( date +' %Y-%m-01' ) - 1 second" +" %Y-%m-%d" )
1213
1213
;;
1214
1214
year)
1215
- FROM_AT=$( date -d " today " +" %Y-01-01" )
1216
- TO_AT=$( date -d " today " +" %Y-12-31" )
1215
+ FROM_AT=$( date +" %Y-01-01" )
1216
+ TO_AT=$( date +" %Y-12-31" )
1217
1217
;;
1218
1218
previous-year)
1219
1219
FROM_AT=$( date -d " today - 1 year" +" %Y-01-01" )
You can’t perform that action at this time.
0 commit comments