I am just a few hours new to TeX and have been tasked to modify an existing template (tex) document for parsing.
I have this in an cls
file that works fine to add #1
days to today's date:
\newcommand*{\duedate}[1]{%
\setdatetoday%
\addtocounter{datenumber}{#1}%
\setdatebynumber{\thedatenumber}%
\datedate%
}
However, I need to change it to a base date #2
I would pass in as an additional parameter, and then have it add #1
.
I tried using \date
, but it continues to pickup today's date.
\newcommand*{\duedate}[2]{%
\date{#2}%
\addtocounter{datenumber}{#1}%
\setdatebynumber{\thedatenumber}%
\datedate%
}
As well as \setdate
.
However, the output is always today's date + #1
.
If there is documentation to read on how to set a date, and add "days" to a date, please point me to it. I'd be more than happy to read up on proper syntex (phun)!
datanumber
in mycls
, and thisdatetime2
package. So if there's a way to resolve my question with just the OP code, it would be preferred so I do not have to define the function in the answer below.