From d69f376bd51012df2b1c2a4fbc1d4bc56edc1afd Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Fri, 22 Jan 2016 23:15:21 +0000
Subject: datetime2 (22jan16)

git-svn-id: svn://tug.org/texlive/trunk@39458 c570f23f-e606-0410-a88d-b1316a301751
---
 .../tex/latex/datetime2/datetime2-calc.sty         | 243 ++++++++++++++++++++-
 1 file changed, 241 insertions(+), 2 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty')

diff --git a/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty b/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty
index d496ec76abd..ced8e9a5a70 100644
--- a/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty
+++ b/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty
@@ -7,7 +7,7 @@
 %% datetime2.dtx  (with options: `datetime2-calc.sty,package')
 %% 
 %%  datetime2.dtx
-%%  Copyright 2015 Nicola Talbot
+%%  Copyright 2016 Nicola Talbot
 %% 
 %%  This work may be distributed and/or modified under the
 %%  conditions of the LaTeX Project Public License, either version 1.3
@@ -39,7 +39,7 @@
 %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
 %%   Right brace   \}     Tilde         \~}
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datetime2-calc}[2015/11/10 v1.2 (NLCT)]
+\ProvidesPackage{datetime2-calc}[2016/01/22 v1.3 (NLCT)]
 \RequirePackage{pgfkeys}
 \RequirePackage{pgfcalendar}
 \newcount\@dtm@julianday
@@ -223,6 +223,245 @@
   \csdef{@dtm@#1@TZhour}{0}%
   \csdef{@dtm@#1@TZminute}{0}%
 }
+\newcommand*{\dtm@ifdianameexists}[3]{%
+ \IfTrackedDialect{\languagename}%
+ {%
+   \ifcsdef{DTM\TrackedLanguageFromDialect{\languagename}#1}%
+   {#2}%
+   {#3}%
+ }%
+ {#3}%
+}
+\newrobustcmd{\DTMmonthname}[1]{%
+  \ifcsdef{DTM\languagename monthname}%
+  {%
+    \csuse{DTM\languagename monthname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{monthname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}monthname}{#1}%
+    }%
+    {%
+      \dtmnamewarning{\DTMmonthname}%
+      \pgfcalendarmonthname{#1}%
+    }%
+  }%
+}
+\newrobustcmd{\DTMMonthname}[1]{%
+  \ifcsdef{DTM\languagename Monthname}%
+  {%
+    \csuse{DTM\languagename Monthname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{Monthname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}Monthname}{#1}%
+    }%
+    {%
+      \ifcsdef{DTM\languagename monthname}%
+      {%
+        \csuse{DTM\languagename monthname}{#1}%
+      }%
+      {%
+        \dtm@ifdianameexists{monthname}%
+        {%
+          \csuse{DTM\TrackedLanguageFromDialect{\languagename}monthname}{#1}%
+        }%
+        {%
+          \dtmnamewarning{\DTMMonthname}%
+          \ifdef\emakefirstuc
+          {%
+           \emakefirstuc{\pgfcalendarmonthname{#1}}%
+          }%
+          {%
+            \protected@edef\dtm@tmp@monthname{\pgfcalendarmonthname{#1}}%
+            \expandafter\MakeUppercase\dtm@tmp@monthname
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\newrobustcmd{\DTMshortmonthname}[1]{%
+  \ifcsdef{DTM\languagename shortmonthname}%
+  {%
+    \csuse{DTM\languagename shortmonthname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{shortmonthname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortmonthname}{#1}%
+    }%
+    {%
+      \dtmnamewarning{\DTMshortmonthname}%
+      \pgfcalendarmonthshortname{#1}%
+    }%
+  }%
+}
+\newrobustcmd{\DTMshortMonthname}[1]{%
+  \ifcsdef{DTM\languagename shortMonthname}%
+  {%
+    \csuse{DTM\languagename shortMonthname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{shortMonthname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortMonthname}{#1}%
+    }%
+    {%
+      \ifcsdef{DTM\languagename shortmonthname}%
+      {%
+        \csuse{DTM\languagename shortmonthname}{#1}%
+      }%
+      {%
+        \dtm@ifdianameexists{shortmonthname}%
+        {%
+           \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortmonthname}%
+           {#1}%
+        }%
+        {%
+          \dtmnamewarning{\DTMshortMonthname}%
+          \ifdef\emakefirstuc
+          {%
+           \emakefirstuc{\pgfcalendarmonthshortname{#1}}%
+          }%
+          {%
+            \protected@edef\dtm@tmp@monthname{\pgfcalendarmonthshortname{#1}}%
+            \expandafter\MakeUppercase\dtm@tmp@monthname
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\newrobustcmd{\DTMweekdayname}[1]{%
+  \ifcsdef{DTM\languagename weekdayname}%
+  {%
+    \csuse{DTM\languagename weekdayname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{weekdayname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}weekdayname}{#1}%
+    }%
+    {%
+      \dtmnamewarning{\DTMweekdayname}%
+      \pgfcalendarweekdayname{#1}%
+    }%
+  }%
+}
+\newrobustcmd{\DTMWeekdayname}[1]{%
+  \ifcsdef{DTM\languagename Weekdayname}%
+  {%
+    \csuse{DTM\languagename Weekdayname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{Weekdayname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}Weekdayname}{#1}%
+    }%
+    {%
+      \ifcsdef{DTM\languagename weekdayname}%
+      {%
+        \csuse{DTM\languagename weekdayname}{#1}%
+      }%
+      {%
+        \dtm@ifdianameexists{weekdayname}%
+        {%
+           \csuse{DTM\TrackedLanguageFromDialect{\languagename}weekdayname}{#1}%
+        }%
+        {%
+          \dtmnamewarning{\DTMWeekdayname}%
+          \ifdef\emakefirstuc
+          {%
+           \emakefirstuc{\pgfcalendarweekdayname{#1}}%
+          }%
+          {%
+            \protected@edef\dtm@tmp@weekdayname{\pgfcalendarweekdayname{#1}}%
+            \expandafter\MakeUppercase\dtm@tmp@weekdayname
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\newrobustcmd{\DTMshortweekdayname}[1]{%
+  \ifcsdef{DTM\languagename shortweekdayname}%
+  {%
+    \csuse{DTM\languagename shortweekdayname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{shortweekdayname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortweekdayname}{#1}%
+    }%
+    {%
+      \dtmnamewarning{\DTMshortweekdayname}%
+      \pgfcalendarweekdayshortname{#1}%
+    }%
+  }%
+}
+\newrobustcmd{\DTMshortWeekdayname}[1]{%
+  \ifcsdef{DTM\languagename shortWeekdayname}%
+  {%
+    \csuse{DTM\languagename shortWeekdayname}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{shortWeekdayname}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortWeekdayname}{#1}%
+    }%
+    {%
+      \ifcsdef{DTM\languagename shortweekdayname}%
+      {%
+        \csuse{DTM\languagename shortweekdayname}{#1}%
+      }%
+      {%
+        \dtm@ifdianameexists{shortweekdayname}%
+        {%
+           \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortweekdayname}%
+           {#1}%
+        }%
+        {%
+          \dtmnamewarning{\DTMshortWeekdayname}%
+          \ifdef\emakefirstuc
+          {%
+           \emakefirstuc{\pgfcalendarweekdayshortname{#1}}%
+          }%
+          {%
+            \protected@edef\dtm@tmp@weekdayname{%
+              \pgfcalendarweekdayshortname{#1}}%
+            \expandafter\MakeUppercase\dtm@tmp@weekdayname
+          }%
+        }%
+      }%
+    }%
+  }%
+}
+\newrobustcmd{\DTMordinal}[1]{%
+  \ifcsdef{DTM\languagename ordinal}%
+  {%
+    \csuse{DTM\languagename ordinal}{#1}%
+  }%
+  {%
+    \dtm@ifdianameexists{ordinal}%
+    {%
+       \csuse{DTM\TrackedLanguageFromDialect{\languagename}ordinal}{#1}%
+    }%
+    {%
+      \number#1
+    }%
+  }%
+}
+\newcommand*{\dtmnamewarning}[1]{%
+ \if@dtm@warn
+  \PackageWarning{datetime2-calc}%
+  {Can't find underlying language macro for \MessageBreak
+   \string#1\space(language: \languagename); \MessageBreak
+    using pgfcalendar macro instead}%
+ \fi
+}
 \endinput
 %%
 %% End of file `datetime2-calc.sty'.
-- 
cgit v1.2.3

