summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/projlib/PJLdate.sty
blob: 5d18eb543486ee7bcb54be0df2efb5fadb9930e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
%%
%% This is file `PJLdate.sty',
%% generated with the docstrip utility.

%% Copyright (C) 2021 by Jinwen XU
%% 
%% This is part of the ProjLib Toolkit.
%% 
%% This work may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License, either version 1.3c of this license or (at
%% your option) any later version. The latest version of this license is in
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.3c or later is part of all distributions of LaTeX version
%% 2005/12/01 or later.
%% 
\NeedsTeXFormat{LaTeX2e}[2020-10-01]
\ProvidesPackage{PJLdate}
    [2021/07/27 Convert yyyy-mm-dd to normal datetime format]
\RequirePackage{kvoptions}
\RequirePackage{etoolbox}
\SetupKeyvalOptions{
    family = @PJLdate,
    prefix = @PJLdate@,
}
\DeclareBoolOption[false]{draft}
\DeclareBoolOption[false]{fast}
\ProcessKeyvalOptions*\relax
\if@PJLdate@draft
    \@PJLdate@fasttrue
\fi
\DeclareDocumentCommand{\PLdate}{}{\PJLdate}
\if@PJLdate@fast\let\PJLdate\relax\endinput\fi

\RequirePackage{PJLlang}

\robustify\@latex@warning@no@line

\RequirePackage{silence}
\WarningFilter*{datetime2}{Date-Time Language Module}
\PassOptionsToPackage{fr-FR,en-US}{datetime2}
\RequirePackage{datetime2}
\RequirePackage{zhnumber}

\let\@DTMdate@PJLoriginal\@DTMdate
\gappto{\PJLlang@langconfig@common}{%
    \let\@DTMdate\@DTMdate@PJLoriginal%
}
\gappto{\PJLlang@langconfig@chinese}{%
    \renewcommand*{\@DTMdate}[1]{%
    \expandafter\@dtm@parsedate#1\@dtm@endparsedate%
    \zhdate{\@dtm@year/\@dtm@month/\@dtm@day}%
    }%
}
\gappto{\PJLlang@langconfig@tchinese}{%
    \renewcommand*{\@DTMdate}[1]{%
    \expandafter\@dtm@parsedate#1\@dtm@endparsedate%
    \zhdate{\@dtm@year/\@dtm@month/\@dtm@day}%
    }%
}
\gappto{\PJLlang@langconfig@japanese}{%
    \renewcommand*{\@DTMdate}[1]{%
    \expandafter\@dtm@parsedate#1\@dtm@endparsedate%
    \zhdate{\@dtm@year/\@dtm@month/\@dtm@day}%
    }%
}

\providecommand*{\PJLdate}[1]{\DTMdate{#1}}

\endinput
%%
%% End of file `PJLdate.sty'.