Debian Codegraph @

texmf-dist/source/latex/datetime2-german/datetime2-de-AT.dtx

raw
1 %\iffalse
2 %<*package>
3 %% \CharacterTable
4 %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
5 %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
6 %% Digits \0\1\2\3\4\5\6\7\8\9
7 %% Exclamation \! Double quote \" Hash (number) \#
8 %% Dollar \$ Percent \% Ampersand \&
9 %% Acute accent \' Left paren \( Right paren \)
10 %% Asterisk \* Plus \+ Comma \,
11 %% Minus \- Point \. Solidus \/
12 %% Colon \: Semicolon \; Less than \<
13 %% Equals \= Greater than \> Question mark \?
14 %% Commercial at \@ Left bracket \[ Backslash \\
15 %% Right bracket \] Circumflex \^ Underscore \_
16 %% Grave accent \` Left brace \{ Vertical bar \|
17 %% Right brace \} Tilde \~}
18 %</package>
19 %
20 % Doc-Source file to use with LaTeX2e
21 % Copyright (C) 2015 Nicola Talbot, all rights reserved.
22 % Copyright (C) 2017-19 Sebastian Friedl, all rights reserved.
23 % \fi
24 %
25 %
26 %
27 % \subsection{Austrian German (de-AT): \texttt{datetime2-de-AT.ldf}}
28 % \changes{2.0}{2017-10-03}{Added regional variant: Austrian German (de-AT)}
29 %
30 % Identify Module.
31 % \begin{macrocode}
32 \ProvidesDateTimeModule{de-AT}[2019/12/13 v3.0]
33 % \end{macrocode}
34 % Require the base German module.
35 % \begin{macrocode}
36 \RequireDateTimeModule{german-base}
37 % \end{macrocode}
38 %
39 %
40 % Allow the to configure the "de-AT" and "de-AT-numeric" styles.
41 % The package wide separators such as \cs{dtm@datetimesep} are not used
42 % in case other date formats are also required.
43 %
44 %\begin{macro}{\DTMdeATdowdaysep}
45 % The separator between weekday and day
46 % \begin{macrocode}
47 \newcommand*{\DTMdeATdowdaysep}{,\space}
48 % \end{macrocode}
49 %\end{macro}
50 %
51 %\begin{macro}{\DTMdeATdaymonthsep}
52 % The separator between the day and month for the text format.
53 % \begin{macrocode}
54 \newcommand*{\DTMdeATdaymonthsep}{.\DTMtexorpdfstring{\protect~}{\space}}
55 % \end{macrocode}
56 %\end{macro}
57 %
58 %\begin{macro}{\DTMdeATmonthyearsep}
59 % The separator between the month and year for the text format.
60 % \begin{macrocode}
61 \newcommand*{\DTMdeATmonthyearsep}{\space}
62 % \end{macrocode}
63 %\end{macro}
64 %
65 %\begin{macro}{\DTMdeATdatetimesep}
66 % The separator between the date and time blocks in the full format
67 % (either text or numeric).
68 % \begin{macrocode}
69 \newcommand*{\DTMdeATdatetimesep}{,\space}
70 % \end{macrocode}
71 %\end{macro}
72 %
73 %\begin{macro}{\DTMdeATtimezonesep}
74 % The separator between the time and zone blocks in the full format
75 % (either text or numeric).
76 % \begin{macrocode}
77 \newcommand*{\DTMdeATtimezonesep}{\space}
78 % \end{macrocode}
79 %\end{macro}
80 %
81 %\begin{macro}{\DTMdeATdatesep}
82 % The separator for the numeric date format.
83 % \begin{macrocode}
84 \newcommand*{\DTMdeATdatesep}{.}
85 % \end{macrocode}
86 %\end{macro}
87 %
88 %\begin{macro}{\DTMdeATtimesep}
89 % The separator for the numeric time format.
90 % \begin{macrocode}
91 \newcommand*{\DTMdeATtimesep}{:}
92 % \end{macrocode}
93 %\end{macro}
94 %
95 % Provide keys that can be used in \cs{DTMlangsetup} to set these
96 % separators.
97 % \begin{macrocode}
98 \DTMdefkey{de-AT}{dowdaysep}{\renewcommand*{\DTMdeATdowdaysep}{#1}}
99 \DTMdefkey{de-AT}{daymonthsep}{\renewcommand*{\DTMdeATdaymonthsep}{#1}}
100 \DTMdefkey{de-AT}{monthyearsep}{\renewcommand*{\DTMdeATmonthyearsep}{#1}}
101 \DTMdefkey{de-AT}{datetimesep}{\renewcommand*{\DTMdeATdatetimesep}{#1}}
102 \DTMdefkey{de-AT}{timezonesep}{\renewcommand*{\DTMdeATtimezonesep}{#1}}
103 \DTMdefkey{de-AT}{datesep}{\renewcommand*{\DTMdeATdatesep}{#1}}
104 \DTMdefkey{de-AT}{timesep}{\renewcommand*{\DTMdeATtimesep}{#1}}
105 % \end{macrocode}
106 %
107 %
108 % Define a boolean key that can switch between full and abbreviated formats for
109 % the month and day of week names.
110 % \begin{macrocode}
111 \DTMdefboolkey{de-AT}{abbr}[true]{}
112 % \end{macrocode}
113 %
114 % The default is to show the full names.
115 % \begin{macrocode}
116 \DTMsetbool{de-AT}{abbr}{false}
117 % \end{macrocode}
118 %
119 % Define a boolean key that determines if the time zone mappings
120 % should be used.
121 % \begin{macrocode}
122 \DTMdefboolkey{de-AT}{mapzone}[true]{}
123 % \end{macrocode}
124 % The default is to use mappings.
125 % \begin{macrocode}
126 \DTMsetbool{de-AT}{mapzone}{true}
127 % \end{macrocode}
128 %
129 % Define a boolean key that determines if the day of month should be
130 % displayed.
131 % \begin{macrocode}
132 \DTMdefboolkey{de-AT}{showdayofmonth}[true]{}
133 % \end{macrocode}
134 % The default is to show the day of month.
135 % \begin{macrocode}
136 \DTMsetbool{de-AT}{showdayofmonth}{true}
137 % \end{macrocode}
138 %
139 % Define a boolean key that determines if the year should be
140 % displayed.
141 % \begin{macrocode}
142 \DTMdefboolkey{de-AT}{showyear}[true]{}
143 % \end{macrocode}
144 % The default is to show the year.
145 % \begin{macrocode}
146 \DTMsetbool{de-AT}{showyear}{true}
147 % \end{macrocode}
148 %
149 %
150 % Define the "de-AT" style.
151 % \begin{macrocode}
152 \DTMnewstyle
153 {de-AT}% label
154 {% date style
155 \renewcommand*\DTMdisplaydate[4]{%
156 \ifDTMshowdow
157 \ifnum##4>-1
158 \DTMifbool{de-AT}{abbr}%
159 {\DTMgermanshortweekdayname{##4}}%
160 {\DTMgermanweekdayname{##4}}%
161 \DTMdeATdowdaysep
162 \fi
163 \fi
164 %
165 \DTMifbool{de-AT}{showdayofmonth}%
166 {\DTMgermanordinal{##3}\DTMdeATdaymonthsep}%
167 {}%
168 %
169 \DTMifbool{de-AT}{abbr}%
170 {\DTMdeATshortmonthname{##2}}%
171 {\DTMdeATmonthname{##2}}%
172 %
173 \DTMifbool{de-AT}{showyear}%
174 {%
175 \DTMdeATmonthyearsep%
176 \number##1 % space intended
177 }%
178 {}%
179 }%
180 \renewcommand*\DTMDisplaydate[4]{%
181 \ifDTMshowdow
182 \ifnum##4>-1
183 \DTMifbool{de-AT}{abbr}%
184 {\DTMgermanshortweekdayname{##4}}%
185 {\DTMgermanweekdayname{##4}}%
186 \DTMdeATdowdaysep
187 \fi
188 \fi
189 %
190 \DTMifbool{de-AT}{showdayofmonth}%
191 {\DTMgermanordinal{##3}\DTMdeATdaymonthsep}%
192 {}%
193 %
194 \DTMifbool{de-AT}{abbr}%
195 {\DTMdeATshortmonthname{##2}}%
196 {\DTMdeATmonthname{##2}}%
197 %
198 \DTMifbool{de-AT}{showyear}%
199 {%
200 \DTMdeATmonthyearsep%
201 \number##1 % space intended
202 }%
203 {}%
204 }%
205 }%
206 {% time style (use default)
207 \renewcommand*\DTMdisplaytime[3]{%
208 \DTMtwodigits{##1}%
209 \DTMdeATtimesep\DTMtwodigits{##2}%
210 \ifDTMshowseconds\DTMdeATtimesep\DTMtwodigits{##3}\fi
211 }%
212 }%
213 {% zone style
214 \DTMresetzones
215 \DTMgermanzonemaps
216 \renewcommand*{\DTMdisplayzone}[2]{%
217 \DTMifbool{de-AT}{mapzone}%
218 {\DTMusezonemapordefault{##1}{##2}}%
219 {%
220 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
221 \ifDTMshowzoneminutes\DTMdeATtimesep\DTMtwodigits{##2}\fi
222 }%
223 }%
224 }%
225 {% full style
226 \renewcommand*{\DTMdisplay}[9]{%
227 \ifDTMshowdate
228 \DTMdisplaydate{##1}{##2}{##3}{##4}%
229 \DTMdeATdatetimesep
230 \fi
231 \DTMdisplaytime{##5}{##6}{##7}%
232 \ifDTMshowzone
233 \DTMdeATtimezonesep
234 \DTMdisplayzone{##8}{##9}%
235 \fi
236 }%
237 \renewcommand*{\DTMDisplay}[9]{%
238 \ifDTMshowdate
239 \DTMDisplaydate{##1}{##2}{##3}{##4}%
240 \DTMdeATdatetimesep
241 \fi
242 \DTMdisplaytime{##5}{##6}{##7}%
243 \ifDTMshowzone
244 \DTMdeATtimezonesep
245 \DTMdisplayzone{##8}{##9}%
246 \fi
247 }%
248 }%
249 % \end{macrocode}
250 %
251 % Define the corresponding numeric style.
252 % \changes{3.0}{2019-12-13}{Change Austrian numeric style}
253 % \begin{macrocode}
254 \DTMnewstyle
255 {de-AT-numeric}% label
256 {% date style
257 \renewcommand*\DTMdisplaydate[4]{%
258 \ifDTMshowdow
259 \ifnum##4>-1
260 \DTMifbool{de-AT}{abbr}%
261 {\DTMgermanshortweekdayname{##4}}%
262 {\DTMgermanweekdayname{##4}}%
263 \DTMdeATdowdaysep
264 \fi
265 \fi
266 %
267 \DTMifbool{de-AT}{showdayofmonth}%
268 {%
269 \DTMtwodigits{##3}%
270 \DTMdeATdatesep
271 }%
272 {}%
273 \DTMtwodigits{##2}%
274 \DTMdeATdatesep%
275 \DTMifbool{de-AT}{showyear}%
276 {%
277 \DTMifbool{de-AT}{abbr}%
278 {\DTMtwodigits{##1}}%
279 {\number##1 }% space intended
280 }%
281 {}%
282 }%
283 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
284 }%
285 {% time style
286 \renewcommand*\DTMdisplaytime[3]{%
287 \DTMtwodigits{##1}%
288 \DTMdeATtimesep\DTMtwodigits{##2}%
289 \ifDTMshowseconds\DTMdeATtimesep\DTMtwodigits{##3}\fi
290 }%
291 }%
292 {% zone style
293 \DTMresetzones
294 \DTMgermanzonemaps
295 \renewcommand*{\DTMdisplayzone}[2]{%
296 \DTMifbool{de-AT}{mapzone}%
297 {\DTMusezonemapordefault{##1}{##2}}%
298 {%
299 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
300 \ifDTMshowzoneminutes\DTMgermantimesep\DTMtwodigits{##2}\fi
301 }%
302 }%
303 }%
304 {% full style
305 \renewcommand*{\DTMdisplay}[9]{%
306 \ifDTMshowdate
307 \DTMdisplaydate{##1}{##2}{##3}{##4}%
308 \DTMdeATdatetimesep
309 \fi
310 \DTMdisplaytime{##5}{##6}{##7}%
311 \ifDTMshowzone
312 \DTMdeATtimezonesep
313 \DTMdisplayzone{##8}{##9}%
314 \fi
315 }%
316 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
317 }
318 % \end{macrocode}
319 %
320 % Switch the style according to the \opt{useregional} setting.
321 % \begin{macrocode}
322 \DTMifcaseregional
323 {}% do nothing
324 {\DTMsetstyle{de-AT}}%
325 {\DTMsetstyle{de-AT-numeric}}%
326 % \end{macrocode}
327 %
328 % Redefine \cs{dategerman} (or \cs{date}\meta{dialect}) to prevent
329 % \sty{babel} from resetting \cs{today}. (For this to work,
330 % \sty{babel} must already have been loaded if it's required.)
331 % \begin{macrocode}
332 \ifcsundef{date\CurrentTrackedDialect}
333 {%
334 \ifundef\dategerman
335 {}% do nothing
336 {%
337 \def\dategerman{%
338 \DTMifcaseregional
339 {}% do nothing
340 {\DTMsetstyle{de-AT}}%
341 {\DTMsetstyle{de-AT-numeric}}%
342 }%
343 }%
344 }%
345 {%
346 \csdef{date\CurrentTrackedDialect}{%
347 \DTMifcaseregional
348 {}% do nothing
349 {\DTMsetstyle{de-AT}}%
350 {\DTMsetstyle{de-AT-numeric}}%
351 }%
352 }%
353 % \end{macrocode}
354 %
355 \endinput