Skip to content

Commit

Permalink
Merge pull request #25 from michaelroland/date-accepts-iso-date
Browse files Browse the repository at this point in the history
Print date in current language format if \date{YYYY-MM-DD} is given a…
  • Loading branch information
michaelroland authored Dec 20, 2024
2 parents 77e2428 + 03babe0 commit b74adaa
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions jkureport.sty
Original file line number Diff line number Diff line change
Expand Up @@ -1965,10 +1965,15 @@
\newcommand{\jkureport@insertsubmissiondate}{%
\begingroup%
\DTMsetstyle{iso}%
\edef\@tmp{\noexpand\DTMsavedate{submissiondate}{\@date}}\@tmp%
\DTMmonthname{\DTMfetchmonth{submissiondate}}~\DTMfetchyear{submissiondate}%
\edef\@tmp{\noexpand\DTMsavedate{jkureport@docdate}{\@date}}\@tmp%
\DTMmonthname{\DTMfetchmonth{jkureport@docdate}}~\DTMfetchyear{jkureport@docdate}%
\endgroup%
}
\ExplSyntaxOn
\NewDocumentCommand{\jkureport@ifisodate}{mmm}{
\regex_match:nnTF {\A\d{4}-?\d{2}-?\d{2}\Z} {#1} {#2} {#3}
}
\ExplSyntaxOff
\newcommand{\jkureport@insertdate}{%
\ifdefstring{\jkureport@doctype}{thesis}{%
\ifdefstring{\jkureport@docsubtype}{seminar}{%
Expand All @@ -1977,7 +1982,14 @@
\jkureport@insertsubmissiondate%
}%
}{%
\protect\@date%
\expandafter\jkureport@ifisodate\expandafter{\@date}{%
\begingroup%
\edef\@tmp{\noexpand\DTMsavedate{jkureport@docdate}{\@date}}\@tmp%
\DTMusedate{jkureport@docdate}%
\endgroup%
}{%
\protect\@date%
}%
}%
}
\newcommand{\jkureport@insertplace}{Linz}%
Expand Down

0 comments on commit b74adaa

Please sign in to comment.