mirror of
https://github.com/simonmichael/hledger.git
synced 2024-11-07 21:15:19 +03:00
;tools: just twih: date fixes
This commit is contained in:
parent
007f2eba15
commit
831b4638cb
9
Justfile
9
Justfile
@ -920,17 +920,20 @@ NEWS:
|
|||||||
# @_datearg *DATEARG:
|
# @_datearg *DATEARG:
|
||||||
# echo {{ if DATEARG == '' { `just reldate` } else { if DATEARG =~ '^\d+$' { `dateadd $(date +%Y-%m-%d) -$DATEARG` } else { DATEARG } } }}
|
# echo {{ if DATEARG == '' { `just reldate` } else { if DATEARG =~ '^\d+$' { `dateadd $(date +%Y-%m-%d) -$DATEARG` } else { DATEARG } } }}
|
||||||
|
|
||||||
|
#dateround := 'dateround -n'
|
||||||
|
dateround := 'dateround'
|
||||||
|
|
||||||
# If DATE is provided, return it, otherwise the date two fridays ago.
|
# If DATE is provided, return it, otherwise the date two fridays ago.
|
||||||
@_dateorsecondlatestfriday *DATE:
|
@_dateorsecondlatestfriday *DATE:
|
||||||
echo {{ if DATE == '' { `gdate -I -d "$(dateround today -n -- -fri) - 1 week"` } else { DATE } }}
|
echo {{ if DATE == '' { `gdate -I -d "$($dateround today -- -fri) - 1 week"` } else { DATE } }}
|
||||||
|
|
||||||
# If DATE is provided, return today's date, otherwise the most recent friday's (possibly today).
|
# If DATE is provided, return today's date, otherwise the most recent friday's (possibly today).
|
||||||
@_todayorlatestfriday *DATE:
|
@_todayorlatestfriday *DATE:
|
||||||
echo {{ if DATE == '' { `dateround today -n -- -fri` } else { `$GDATE -I` } }}
|
echo {{ if DATE == '' { `$dateround today -- -fri` } else { `$GDATE -I` } }}
|
||||||
|
|
||||||
# If DATE is provided, return tomorrow's date, otherwise last friday's.
|
# If DATE is provided, return tomorrow's date, otherwise last friday's.
|
||||||
@_tomorroworlatestfriday *DATE:
|
@_tomorroworlatestfriday *DATE:
|
||||||
echo {{ if DATE == '' { `dateround today -n -- -fri` } else { `$GDATE -I -d tomorrow` } }}
|
echo {{ if DATE == '' { `$dateround today -- -fri` } else { `$GDATE -I -d tomorrow` } }}
|
||||||
|
|
||||||
# Show a draft This Week In Hledger post, with activity between the last two fridays (by default)
|
# Show a draft This Week In Hledger post, with activity between the last two fridays (by default)
|
||||||
twih: # *DATE:
|
twih: # *DATE:
|
||||||
|
Loading…
Reference in New Issue
Block a user