I want to specify a date (and give it a name) in a master header TEX-file, then refer to that date in several independent daughter files. As this doesn't even work within a single file, this simplifies to the following MWE:
% Compile with XeLaTeX
\documentclass[a4paper,12pt,]{article}
\usepackage{polyglossia}
\usepackage[british]{datetime2}
\usepackage{datetime2-calc}
\begin{document}
The present date: \DTMdate{2018-01-24}
Two weeks later: \DTMdate{2018-01-24+14}
Beautiful!
\DTMsavedate{RandomDate}{1991-02-03}
% FAULTY LINES JUST TO SHOW WHAT I TRIED THAT DOESN'T WORK
%\DTMsavedate{RandomDate1}{\DTMdisplaydate{2004}{05}{06}{3}}
%\DTMsavedate{RandomDate2}{\DTMdate{2017-08-09}}
% AND OF COURSE IT DOESN'T, BUT AT LEAST I TRIED.
% IT WOULD HAVE BEEN TOO EASY! :D
A random date \DTMusedate{RandomDate}
%Two weeks later: \DTMdate{RandomDate+14} <------------------------------PROBLEM
\end{document}
How can I specify a date and use that date to calculate 1, 2, 3, etc. weeks from that date?
I did not find the answer in the following documents:
- The
datetime2documentation (although, arguably, if it's not in there, then there shouldn't be a solution, but maybe I have overseen the relevant paragraph. - how to specify a date and then use it with a time format defined using the package datetime
And I don't understand what I am to do with Calculations with dates, although I suspect it to hold the solution I am looking for.
