exsheet2: Fix \date
[exsheet.git] / exsheet2.cls
index c9a5826548a3c01808f8bd4c9f41876d3af155a1..250ea65c96a4cac6e17dc2a39d4579d731ccb384 100644 (file)
@@ -23,7 +23,6 @@
 
 \@ifundefined{exsheetgerman}{
   \usepackage[american]{babel}
-  \usepackage[american]{isodate}
   \newcommand{\theexercise}{Exercise}
   \newcommand{\thepoint}{Point}
   \newcommand{\thepoints}{Points}
@@ -35,7 +34,6 @@
   \newcommand{\theof}{of}
 }{%
   \usepackage[ngerman]{babel}
-  \usepackage[german]{isodate}
   \newcommand{\theexercise}{Aufgabe}
   \newcommand{\thepoint}{Punkt}
   \newcommand{\thepoints}{Punkte}
@@ -47,6 +45,8 @@
   \newcommand{\theof}{von}
 }
 
+\usepackage[useregional]{datetime2}
+
 \RequirePackage{xifthen,geometry,fancyhdr,enumitem,comment,amssymb}
 
 \newcounter{exsheet2@pointsum}
 \def\@instructions{\ }
 \newcommand{\instructions}[1]{\def\@instructions{#1}}
 
+\let\olddate\date
+\DTMsavenow{exsheet2@today}
+\renewcommand{\date}[1]{\olddate{#1}\DTMsavedate{exsheet2@today}{#1}}
+
 
 \geometry{a4paper,textwidth=16cm,textheight=23cm}
 
     \@semester
   }
   \fancyhead[C]{%
-    {\isodate \today}
+    {\DTMsetdatestyle{iso}\DTMusedate{exsheet2@today}}
   }
   \fancyhead[R]{%
     \@auth\\
 
         \vspace*{1em}
 
-        \today\\
+        {\DTMusedate{exsheet2@today}} \\
 
         \vspace*{1em}
         \@curriculum \\