summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/datetime2/datetime2.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/datetime2/datetime2.sty')
-rw-r--r--Master/texmf-dist/tex/latex/datetime2/datetime2.sty49
1 files changed, 40 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/datetime2/datetime2.sty b/Master/texmf-dist/tex/latex/datetime2/datetime2.sty
index 48d95241b60..c6763902a55 100644
--- a/Master/texmf-dist/tex/latex/datetime2/datetime2.sty
+++ b/Master/texmf-dist/tex/latex/datetime2/datetime2.sty
@@ -39,7 +39,7 @@
%% Grave accent \` Left brace \{ Vertical bar \|
%% Right brace \} Tilde \~}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{datetime2}[2019/10/21 v1.5.4 (NLCT) date and time formats]
+\ProvidesPackage{datetime2}[2019/11/11 v1.5.5 (NLCT) date and time formats]
\RequirePackage{tracklang}
\RequirePackage{etoolbox}
\RequirePackage{xkeyval}[2006/11/18]
@@ -185,12 +185,28 @@
\DeclareOptionX*{%
\ifcsundef{@tracklang@add@\CurrentOption}%
{%
- \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect.
- \MessageBreak Perhaps you have misspelt it or the
- \MessageBreak named dialect may be unsupported or
- \MessageBreak perhaps you forgot to use the `style' key}%
- {Any options that aren't described in the manual are assumed
- \MessageBreak to be language or dialect names.}%
+ \ifundef\TrackIfKnownLanguage
+ {%
+ \PackageError{datetime2}{Unrecognised dialect `\CurrentOption'.
+ If you are using a valid ISO language code
+ please update tracklang.sty to at least v1.3.9}%
+ {Any options that aren't described in the manual are assumed
+ \MessageBreak to be language or dialect names.}%
+ }%
+ {%
+ \TrackIfKnownLanguage{\CurrentOption}%
+ {\renewcommand*{\DTMifcaseregional}[3]{#2}}%
+ {%
+ \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect
+ \MessageBreak and doesn't contain a known language code.
+ \MessageBreak Perhaps you have misspelt it or the
+ \MessageBreak named dialect may be unsupported or
+ \MessageBreak perhaps you forgot the `<key>=' part
+ \MessageBreak for example, `style=\CurrentOption'}%
+ {Any options that aren't described in the manual are assumed
+ \MessageBreak to be language or dialect names.}%
+ }%
+ }%
}%
{%
\TrackPredefinedDialect{\CurrentOption}%
@@ -476,14 +492,29 @@
\number#1\dtm@yearmonthsep\DTMtwodigits{#2}\dtm@monthdaysep\DTMtwodigits{#3}%
}%
\newcommand*{\DTMDisplaydate}{\DTMdisplaydate}
-\newrobustcmd*{\DTMdate}[1]{%
+\newcommand*{\DTMfinaldot}{.}
+\newrobustcmd*{\DTMdate}{\@ifstar\@sDTMdate\@DTMdate}
+\newcommand*{\@DTMdate}[1]{%
\expandafter\@dtm@parsedate#1\@dtm@endparsedate
\DTMdisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}%
}
-\newrobustcmd*{\DTMDate}[1]{%
+\newcommand*{\@sDTMdate}[1]{%
+ {%
+ \let\DTMfinaldot\empty
+ \@DTMdate{#1}%
+ }%
+}
+\newrobustcmd*{\DTMDate}{\@ifstar\@sDTMDate\@DTMDate}
+\newcommand*{\@DTMDate}[1]{%
\expandafter\@dtm@parsedate#1\@dtm@endparsedate
\DTMDisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}%
}
+\newcommand*{\@sDTMDate}[1]{%
+ {%
+ \let\DTMfinaldot\empty
+ \@DTMDate{#1}%
+ }%
+}
\newcommand*{\DTMcurrenttime}{%
\DTMdisplaytime
{\@dtm@currenthour}%