@NEXTDOW
— returns the
next date matching a specified day (or days) of the week. The date may be
returned in any output date format supported by this plugin.
If no output format is specified, it defaults to the local date format with
a four-digit year.
Syntax:
%@NEXTDOW[
dowmask,
date,
index,
fmt]
dowmask | the day(s) of the week to find |
date | the starting date, in any supported input format; defaults to today’s date |
index | which matching day-of-the-week to find; defaults to 1 (next after; see below) |
fmt | the date format used to return the resulting date, and also to interpret ambiguous input dates; defaults to 256 |
When index is 1 (the default), this function
returns the first matching date after today’s date (or the
specified start date.) If index is set to 0,
then @NEXTDOW
will return the first matching date on or
after today. If index is -1, then the
last matching date before today’s date is returned.
Higher (or lower) values for index will return
later (or earlier) matching dates.
For example:
echo Next Wednesday: %@nextdow[wed]
echo Wednesday after next: %@nextdow[wed,,2]
echo Next Monday or Tuesday: %@nextdow[mon tue]
echo First Monday after Christmas: %@nextdow[mon,%_year-12-25]
echo Last Friday before Christmas: %@nextdow[fri,%_year-12-25,-1]
• New: This function does not exist in Take Command.