Debian Codegraph @

texmf-dist/source/latex/datetime2-italian/datetime2-italian.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 %\fi
20 % \iffalse
21 % Doc-Source file to use with LaTeX2e
22 % Copyright (C) 2015 Nicola Talbot, all rights reserved.
23 % \fi
24 % \iffalse
25 %<*driver>
26 \documentclass{ltxdoc}
27
28 \usepackage{alltt}
29 \usepackage{graphicx}
30 \usepackage[utf8]{inputenc}
31 \usepackage[T1]{fontenc}
32 \usepackage[colorlinks,
33 bookmarks,
34 hyperindex=false,
35 pdfauthor={Nicola L.C. Talbot},
36 pdftitle={datetime2.sty Italian Module}]{hyperref}
37
38
39 \CheckSum{467}
40
41 \renewcommand*{\usage}[1]{\hyperpage{#1}}
42 \renewcommand*{\main}[1]{\hyperpage{#1}}
43 \IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
44 \setcounter{IndexColumns}{2}
45
46 \newcommand*{\sty}[1]{\textsf{#1}}
47 \newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
48
49 \RecordChanges
50 \PageIndex
51 \CodelineNumbered
52
53 \begin{document}
54 \DocInput{datetime2-italian.dtx}
55 \end{document}
56 %</driver>
57 %\fi
58 %
59 %\MakeShortVerb{"}
60 %
61 %\title{Italian Module for datetime2 Package}
62 %\author{Nicola L. C. Talbot (inactive)}
63 %\date{2015-05-01 (v1.3)}
64 %\maketitle
65 %
66 % This module is currently maintained and may be subject to change.
67 %
68 % The Current Maintainer of this work is Claudio Duchi claduc at libero dot it
69 %\begin{abstract}
70 %This is the Italian language module for the \sty{datetime2}
71 %package. If you want to use the settings in this module you must
72 %install it in addition to installing \sty{datetime2}. If you use
73 %\sty{babel} or \sty{polyglossia}, you will need this module to
74 %prevent them from redefining \cs{today}. The \sty{datetime2}
75 % \opt{useregional} setting must be set to "text" or "numeric"
76 % for the language styles to be set.
77 % Alternatively, you can set the style in the document using
78 % \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
79 % depending on the value of the \opt{useregional} setting.
80 %\end{abstract}
81 %\opt{showdow} setting.
82 %
83 %\StopEventually{%
84 %\clearpage
85 %\phantomsection
86 %\addcontentsline{toc}{section}{Change History}%
87 %\PrintChanges
88 %\addcontentsline{toc}{section}{\indexname}%
89 %\PrintIndex}
90 %\section{The Code}
91 %\iffalse
92 % \begin{macrocode}
93 %<*datetime2-italian-utf8.ldf>
94 % \end{macrocode}
95 %\fi
96 %\subsection{UTF-8}
97 %This file contains the settings that use UTF-8 characters. This
98 %file is loaded if XeLaTeX or LuaLaTeX are used. Please make sure
99 %your text editor is set to UTF-8 if you want to view this code.
100 %\changes{1.0}{2015-03-10}{Initial release}
101 %\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
102 %\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
103 %\changes{1.3}{2015-05-01}{bug fif% }
104 % Identify module
105 % \begin{macrocode}
106 \ProvidesDateTimeModule{italian-utf8}[2015/05/01 v1.3]
107 % \end{macrocode}
108 %\begin{macro}{\DTMitalianordinal}
109 % \begin{macrocode}
110 \newcommand*{\DTMitalianordinal}[1]{%
111 \number#1
112 }%
113 % \end{macrocode}
114 %\end{macro}
115 %
116 %\begin{macro}{\DTMitalianmonthname}
117 % Italian month names.
118 % \begin{macrocode}
119 \newcommand*{\DTMitalianmonthname}[1]{%
120 \ifcase#1
121 \or
122 gennaio%
123 \or
124 febbraio%
125 \or
126 marzo%
127 \or
128 aprile%
129 \or
130 maggio%
131 \or
132 giugno%
133 \or
134 luglio%
135 \or
136 agosto%
137 \or
138 settembre%
139 \or
140 ottobre%
141 \or
142 novembre%
143 \or
144 dicembre%
145 \fi
146 }
147 % \end{macrocode}
148 %\end{macro}
149 %
150 %
151 %
152 %\begin{macro}{\DTMitalianweekdayname}
153 %These are provided here but not currently used in the date format.
154 % \begin{macrocode}
155 \newcommand*{\DTMitalianweekdayname}[1]{%
156 \ifcase#1
157 lunedì%
158 \or
159 martedì%
160 \or
161 mercoledì%
162 \or
163 giovedì%
164 \or
165 venerdì%
166 \or
167 sabato%
168 \or
169 domenica%
170 \fi
171 }
172 % \end{macrocode}
173 %\end{macro}
174 %
175 %
176 %\begin{macro}{\DTMitalianshortmonthname}
177 %short mont.
178 % \begin{macrocode}
179 \newcommand*{\DTMitalianshortmonthname}[1]{%
180 \ifcase#1
181 \or
182 gen.%
183 \or
184 feb.%
185 \or
186 mar.%
187 \or
188 apr.%
189 \or
190 mag.%
191 \or
192 giun.%
193 \or
194 lug.%
195 \or
196 aug.%
197 \or
198 set.%
199 \or
200 ott.%
201 \or
202 nov.%
203 \or
204 dic.%
205 \fi
206 }
207 % \end{macrocode}
208 %\end{macro}
209 %\begin{macro}{\DTMitalianshortweekdayname}
210 %short week day.
211 % \begin{macrocode}
212 \newcommand*{\DTMitalianshortweekdayname}[1]{%
213 \ifcase#1
214 lun.%
215 \or
216 mar.%
217 \or
218 mer.%
219 \or
220 gio.%
221 \or
222 ven.%
223 \or
224 sab.%
225 \or
226 dom.%
227 \fi
228 }
229 % \end{macrocode}
230 %\end{macro}
231 %\iffalse
232 % \begin{macrocode}
233 %</datetime2-italian-utf8.ldf>
234 % \end{macrocode}
235 %\fi
236 %\iffalse
237 % \begin{macrocode}
238 %<*datetime2-italian-ascii.ldf>
239 % \end{macrocode}
240 %\fi
241 %\subsection{ASCII}
242 %This file contains the settings that use \LaTeX\ commands for
243 %non-ASCII characters. This should be input if neither XeLaTeX nor
244 %LuaLaTeX are used. Even if the user has loaded \sty{inputenc} with
245 %"utf8", this file should still be used not the
246 %\texttt{datetime2-italian-utf8.ldf} file as the non-ASCII
247 %characters are made active in that situation and would need
248 %protecting against expansion.
249 %\changes{1.0}{2015-03-10}{Initial release}
250 %\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
251 %\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
252 %\changes{1.3}{2015-05-01}{bug fif% }
253 % Identify module
254 % \begin{macrocode}
255 \ProvidesDateTimeModule{italian-ascii}[2015/05/01 v1.3]
256 % \end{macrocode}
257 %
258 %\begin{macro}{\DTMitalianordinal}
259 % \begin{macrocode}
260 \newcommand*{\DTMitalianordinal}[1]{%
261 \number#1
262 }%
263 % \end{macrocode}
264 %\end{macro}
265 %
266 %\begin{macro}{\DTMitalianmonthname}
267 % Italian month names.
268 % \begin{macrocode}
269 \newcommand*{\DTMitalianmonthname}[1]{%
270 \ifcase#1
271 \or
272 gennaio%
273 \or
274 febbraio%
275 \or
276 marzo%
277 \or
278 aprile%
279 \or
280 maggio%
281 \or
282 giugno%
283 \or
284 luglio%
285 \or
286 agosto%
287 \or
288 settembre%
289 \or
290 ottobre%
291 \or
292 novembre%
293 \or
294 dicembre%
295 \fi
296 }
297 % \end{macrocode}
298 %\end{macro}
299 %
300 %
301 %\begin{macro}{\DTMitalianweekdayname}
302 %These are provided here but not currently used in the date format.
303 % \begin{macrocode}
304 \newcommand*{\DTMitalianweekdayname}[1]{%
305 \ifcase#1
306 luned\protect\`i%
307 \or
308 marted\protect\`i%
309 \or
310 mercoled\protect\`i%
311 \or
312 gioved\protect\`i%
313 \or
314 venerd\protect\`i%
315 \or
316 sabato%
317 \or
318 domenica%
319 \fi
320 }
321 % \end{macrocode}
322 %\end{macro}
323 %
324 %
325 %\begin{macro}{\DTMitalianshortmonthname}
326 %short mont.
327 % \begin{macrocode}
328 \newcommand*{\DTMitalianshortmonthname}[1]{%
329 \ifcase#1
330 \or
331 gen.%
332 \or
333 feb.%
334 \or
335 mar.%
336 \or
337 apr.%
338 \or
339 mag.%
340 \or
341 giun.%
342 \or
343 lug.%
344 \or
345 aug.%
346 \or
347 set.%
348 \or
349 ott.%
350 \or
351 nov.%
352 \or
353 dic.%
354 \fi
355 }
356 % \end{macrocode}
357 %\end{macro}
358 %\begin{macro}{\DTMitalianshortweekdayname}
359 %short week day.
360 % \begin{macrocode}
361 \newcommand*{\DTMitalianshortweekdayname}[1]{%
362 \ifcase#1
363 lun.%
364 \or
365 mar.%
366 \or
367 mer.%
368 \or
369 gio.%
370 \or
371 ven.%
372 \or
373 sab.%
374 \or
375 dom.%
376 \fi
377 }
378 % \end{macrocode}
379 %\end{macro}
380 %
381 %\iffalse
382 % \begin{macrocode}
383 %</datetime2-italian-ascii.ldf>
384 % \end{macrocode}
385 %\fi
386 %
387 %\subsection{Main Italian Module (\texttt{datetime2-italian.ldf})}
388 %\changes{1.0}{2015-03-10}{Initial release}
389 %\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
390 %\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
391 %\changes{1.3}{2015-05-01}{bug fif% }
392 %
393 %\iffalse
394 % \begin{macrocode}
395 %<*datetime2-italian.ldf>
396 % \end{macrocode}
397 %\fi
398 %
399 % Identify Module
400 % \begin{macrocode}
401 \ProvidesDateTimeModule{italian}[2015/05/01 v1.3]
402 % \end{macrocode}
403 % Need to find out if XeTeX or LuaTeX are being used.
404 % \begin{macrocode}
405 \RequirePackage{ifxetex,ifluatex}
406 % \end{macrocode}
407 % XeTeX and LuaTeX natively support UTF-8, so load
408 % \texttt{italian-utf8} if either of those engines are used
409 % otherwise load \texttt{italian-ascii}.
410 % \begin{macrocode}
411 \ifxetex
412 \RequireDateTimeModule{italian-utf8}
413 \else
414 \ifluatex
415 \RequireDateTimeModule{italian-utf8}
416 \else
417 \RequireDateTimeModule{italian-ascii}
418 \fi
419 \fi
420 % \end{macrocode}
421 %
422 % Define the \texttt{italian} style.
423 % The time style is the same as the "default" style
424 % provided by \sty{datetime2}.
425 %
426 % the packet defines the styles: "italian",
427 % "italian-numeric", "italianampm" and "italian-twenty-four" styles.
428 %
429 %This doesn't use the package wide
430 % separators such as
431 % \cs{dtm@datetimesep} in case other date formats are also required.
432 %\begin{macro}{\DTMitaliandaymonthsep}
433 % The separator between the day and month for the text format.
434 % \begin{macrocode}
435 \newcommand*{\DTMitaliandaymonthsep}{\space}
436 % \end{macrocode}
437 %\end{macro}
438 %
439 %\begin{macro}{\DTMitalianmonthyearsep}
440 % The separator between the month and year for the text format.
441 % \begin{macrocode}
442 \newcommand*{\DTMitalianmonthyearsep}{\space}
443 % \end{macrocode}
444 %\end{macro}
445 %
446 %\begin{macro}{\DTMitaliandatetimesep}
447 % The separator between the date and time blocks in the full format
448 % (either text or numeric).
449 % \begin{macrocode}
450 \newcommand*{\DTMitaliandatetimesep}{\space}
451 % \end{macrocode}
452 %\end{macro}
453 %
454 %\begin{macro}{\DTMitaliantimezonesep}
455 % The separator between the time and zone blocks in the full format
456 % (either text or numeric).
457 % \begin{macrocode}
458 \newcommand*{\DTMitaliantimezonesep}{\space}
459 % \end{macrocode}
460 %\end{macro}
461 %
462 %\begin{macro}{\DTMitaliandatesep}
463 % The separator for the numeric date format.
464 % \begin{macrocode}
465 \newcommand*{\DTMitaliandatesep}{/}
466 % \end{macrocode}
467 %\end{macro}
468 %
469 %\begin{macro}{\DTMitaliantimesep}
470 % The separator for the numeric time format.
471 % \begin{macrocode}
472 \newcommand*{\DTMitaliantimesep}{:}
473 % \end{macrocode}
474 %\end{macro}
475 %
476 % Provide keys that can be used in \cs{DTMlangsetup} to set these
477 % separators.
478 % \begin{macrocode}
479 \DTMdefkey{italian}{daymonthsep}{\renewcommand*{\DTMitaliandaymonthsep}{#1}}
480 \DTMdefkey{italian}{monthyearsep}{\renewcommand*{\DTMitalianmonthyearsep}{#1}}
481 \DTMdefkey{italian}{datetimesep}{\renewcommand*{\DTMitaliandatetimesep}{#1}}
482 \DTMdefkey{italian}{timezonesep}{\renewcommand*{\DTMitaliantimezonesep}{#1}}
483 \DTMdefkey{italian}{datesep}{\renewcommand*{\DTMitaliandatesep}{#1}}
484 \DTMdefkey{italian}{timesep}{\renewcommand*{\DTMitaliantimesep}{#1}}
485 % \end{macrocode}
486
487 % Define a boolean key that determines if the shortened form
488 % should be used.
489 % \begin{macrocode}
490 \DTMdefboolkey{italian}{abbr}[true]{}
491 % \end{macrocode}
492 % The default is to use abbr
493 % \begin{macrocode}
494 \DTMsetbool{italian}{abbr}{false}
495 % \end{macrocode}
496 %
497 % Define a boolean key that determines if the time zone mappings
498 % should be used.
499 % \begin{macrocode}
500 \DTMdefboolkey{italian}{mapzone}[true]{}
501 % \end{macrocode}
502 % The default is to use mappings.
503 % \begin{macrocode}
504 \DTMsetbool{italian}{mapzone}{true}
505 % \end{macrocode}
506 %
507 % Define a boolean key that determines if the day of month should be
508 % displayed.
509 % \begin{macrocode}
510 \DTMdefboolkey{italian}{showdayofmonth}[true]{}
511 % \end{macrocode}
512 % The default is to show the day of month.
513 % \begin{macrocode}
514 \DTMsetbool{italian}{showdayofmonth}{true}
515 % \end{macrocode}
516 %
517 % Define a boolean key that determines if the year should be
518 % displayed.
519 % \begin{macrocode}
520 \DTMdefboolkey{italian}{showyear}[true]{}
521 % \end{macrocode}
522 % The default is to show the year.
523 % \begin{macrocode}
524 \DTMsetbool{italian}{showyear}{true}
525 % \end{macrocode}
526 %
527 % \begin{macrocode}
528 \newcommand*\DTMitalianam{am}%
529 % \end{macrocode}
530 % \begin{macrocode}
531 \newcommand*\DTMitalianpm{pm}%
532 % \end{macrocode}
533 % \begin{macrocode}
534 \newcommand*\DTMitalianmidnight{mezzanotte}%
535 % \end{macrocode}
536 % \begin{macrocode}
537 \newcommand*\DTMitaliannoon{mezzogiorno}%
538 % \end{macrocode}
539 % \begin{macrocode}
540 \newcommand*{\DTMitalianampmfmt}[1]{#1}
541 % \end{macrocode}
542 % Define the "italian" style. (TODO: implement day of week?)
543 % \begin{macrocode}
544 \DTMnewstyle
545 {italian}% label
546 {% date style
547 % \renewcommand*{\DTMitalianfmtordsuffix}{\DTMitalianfmtordsuffix}%
548 \renewcommand*\DTMdisplaydate[4]{%
549 \ifDTMshowdow
550 \ifnum##4>-1%
551 \DTMifbool{italian}{abbr}%
552 {\DTMitalianshortweekdayname{##4}}%
553 {\DTMitalianweekdayname{##4}}%
554 \space
555 \fi
556 \fi
557 \DTMifbool{italian}{showdayofmonth}%
558 {%
559 \DTMitalianordinal{##3}%
560 \DTMitaliandaymonthsep
561 }%
562 {}%
563 \DTMifbool{italian}{abbr}%
564 {\DTMitalianshortmonthname{##2}}%
565 {\DTMitalianmonthname{##2}}%
566 \DTMifbool{italian}{showyear}%
567 {%
568 \DTMitalianmonthyearsep\number##1 % space intended
569 }%
570 {}%
571 }%
572 \renewcommand*\DTMDisplaydate[4]{%
573 \ifDTMshowdow
574 \ifnum##4>-1%
575 \DTMifbool{italian}{abbr}%
576 {\DTMitalianshortweekdayname{##4}}%
577 {\DTMitalianweekdayname{##4}}%
578 \space
579 \fi
580 \fi
581 \DTMifbool{italian}{showdayofmonth}%
582 {%
583 \DTMitalianordinal{##3}%
584 \DTMitaliandaymonthsep
585 }%
586 {}%
587 \DTMifbool{italian}{abbr}%
588 {\DTMitalianshortmonthname{##2}}%
589 {\DTMitalianmonthname{##2}}%
590 \DTMifbool{italian}{showyear}%
591 {%
592 \DTMitalianmonthyearsep\number##1 % space intended
593 }%
594 {}%
595 }%
596 }%
597 {% time style
598 \renewcommand*\DTMitaliantimesep{\DTMitaliantimesep}%
599 \DTMsettimestyle{default}%
600 }%
601 {% zone style
602 \DTMresetzones
603 \DTMitalianzonemaps
604 \renewcommand*{\DTMdisplayzone}[2]{%
605 \DTMifbool{italian}{mapzone}%
606 {\DTMusezonemapordefault{##1}{##2}}%
607 {%
608 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
609 \ifDTMshowzoneminutes\DTMitaliantimesep\DTMtwodigits{##2}\fi
610 }%
611 }%
612 }%
613 {% full style
614 \renewcommand*{\DTMdisplay}[9]{%
615 \ifDTMshowdate
616 \DTMdisplaydate{##1}{##2}{##3}{##4}%
617 \DTMitaliandatetimesep
618 \fi
619 \DTMdisplaytime{##5}{##6}{##7}%
620 \ifDTMshowzone
621 \DTMitaliantimezonesep
622 \DTMdisplayzone{##8}{##9}%
623 \fi
624 }%
625 \renewcommand*{\DTMDisplay}[9]{%
626 \ifDTMshowdate
627 \DTMDisplaydate{##1}{##2}{##3}{##4}%
628 \DTMitaliandatetimesep
629 \fi
630 \DTMdisplaytime{##5}{##6}{##7}%
631 \ifDTMshowzone
632 \DTMitaliantimezonesep
633 \DTMdisplayzone{##8}{##9}%
634 \fi
635 }%
636 }%
637 % \end{macrocode}
638 %
639 % Define numeric style.
640 % \begin{macrocode}
641 \DTMnewstyle
642 {italian-numeric}% label
643 {% date style
644 \renewcommand*\DTMdisplaydate[4]{%
645 \DTMifbool{italian}{showdayofmonth}%
646 {%
647 \number##3 % space intended
648 \DTMitaliandatesep
649 }%
650 {}%
651 \number##2 % space intended
652 \DTMifbool{italian}{showyear}%
653 {%
654 \DTMitaliandatesep
655 \number##1 % space intended
656 }%
657 {}%
658 }%
659 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
660 }%
661 {% time style
662 \renewcommand*\DTMdisplaytime[3]{%
663 \number##1
664 \DTMitaliantimesep\DTMtwodigits{##2}%
665 \ifDTMshowseconds\DTMitaliantimesep\DTMtwodigits{##3}\fi
666 }%
667 }%
668 {% zone style
669 \DTMresetzones
670 \DTMitalianzonemaps
671 \renewcommand*{\DTMdisplayzone}[2]{%
672 \DTMifbool{italian}{mapzone}%
673 {\DTMusezonemapordefault{##1}{##2}}%
674 {%
675 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
676 \ifDTMshowzoneminutes\DTMitaliantimesep\DTMtwodigits{##2}\fi
677 }%
678 }%
679 }%
680 {% full style
681 \renewcommand*{\DTMdisplay}[9]{%
682 \ifDTMshowdate
683 \DTMdisplaydate{##1}{##2}{##3}{##4}%
684 \DTMitaliandatetimesep
685 \fi
686 \DTMdisplaytime{##5}{##6}{##7}%
687 \ifDTMshowzone
688 \DTMitaliantimezonesep
689 \DTMdisplayzone{##8}{##9}%
690 \fi
691 }%
692 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
693 }
694 % \end{macrocode}
695 %
696 % Define am pm style.
697 % \begin{macrocode}
698 \DTMnewtimestyle
699 {italianampm}% label
700 {%
701 \renewcommand*\DTMdisplaytime[3]{%
702 \ifnum##2=0
703 \ifnum##1=12
704 \DTMtexorpdfstring
705 {\DTMitalianampmfmt{\DTMitaliannoon}}%
706 {\DTMitaliannoon}%
707 \else
708 \ifnum##1=0
709 \DTMtexorpdfstring
710 {\DTMitalianampmfmt{\DTMitalianmidnight}}%
711 {\DTMitalianmidnight}%
712 \else
713 \ifnum##1=24
714 \DTMtexorpdfstring
715 {\DTMitalianampmfmt{\DTMitalianmidnight}}%
716 {\DTMitalianmidnight}%
717 \else
718 \ifnum##1<12
719 \number##1
720 \DTMtexorpdfstring
721 {\DTMitalianampmfmt{\DTMitalianam}}%
722 {\DTMitalianam}%
723 \else
724 \number\numexpr##1-12\relax
725 \DTMtexorpdfstring
726 {\DTMitalianampmfmt{\DTMitalianpm}}%
727 {\DTMitalianpm}%
728 \fi
729 \fi
730 \fi
731 \fi
732 \else
733 \ifnum##1<13
734 \ifnum##1=0
735 12%
736 \else
737 \number##1
738 \fi
739 \DTMitaliantimesep\DTMtwodigits{##2}%
740 \ifnum##1=12
741 \DTMtexorpdfstring
742 {\DTMitalianampmfmt{\DTMitalianam}}%
743 {\DTMitalianpm}%
744 \else
745 \DTMtexorpdfstring
746 {\DTMitalianampmfmt{\DTMitalianam}}%
747 {\DTMitalianam}%
748 \fi
749 \else
750 \number\numexpr##1-12\relax
751 \DTMitaliantimesep\DTMtwodigits{##2}%
752 \ifnum##1=24
753 \DTMtexorpdfstring
754 {\DTMitalianampmfmt{\DTMitalianpm}}%
755 {\DTMitalianam}%
756 \else
757 \DTMtexorpdfstring
758 {\DTMitalianampmfmt{\DTMitalianpm}}%
759 {\DTMitalianpm}%
760 \fi
761 \fi
762 \fi
763 }%
764 }%
765 % \end{macrocode}
766 %
767 % Define italian-twenty-four style.
768 %
769 % \begin{macrocode}
770 \DTMnewtimestyle
771 {italian-twenty-four}% label
772 {%
773 \renewcommand*\DTMdisplaytime[3]{%
774 \ifnum##2=0
775 \ifnum##1=12
776 \DTMtexorpdfstring
777 {\DTMitalianampmfmt{\DTMitaliannoon}}%
778 {\DTMitaliannoon}%
779 \else
780 \ifnum##1=0
781 \DTMtexorpdfstring
782 {\DTMitalianampmfmt{\DTMitalianmidnight}}%
783 {\DTMitalianmidnight}%
784 \else
785 \ifnum##1=24
786 \DTMtexorpdfstring
787 {\DTMitalianampmfmt{\DTMitalianmidnight}}%
788 {\DTMitalianmidnight}%
789 \else
790 \ifnum##1<12
791 \DTMtwodigits{##1}\DTMitaliantimesep\DTMtwodigits{##2}%
792 \else
793 \DTMtwodigits{##1}\DTMitaliantimesep\DTMtwodigits{##2}%
794 \fi
795 \fi
796 \fi
797 \fi
798 \else
799 \ifnum##1<13
800 \ifnum##1=0
801 \DTMtwodigits{##1}%
802 \else
803 \DTMtwodigits{##1}\relax
804 \fi
805 \DTMitaliantimesep\DTMtwodigits{##2}%
806 \else
807 \DTMtwodigits{##1}\relax
808 \DTMitaliantimesep\DTMtwodigits{##2}%
809 \fi
810 \fi
811 }%
812 }%
813 % \end{macrocode}
814 %
815 %
816 %\begin{macro}{\DTMitalianzonemaps}
817 % The time zone mappings are set through this command, which can be
818 % redefined if extra mappings are required or mappings need to be
819 % removed.
820 % \begin{macrocode}
821 \newcommand*{\DTMitalianzonemaps}{%
822 \DTMdefzonemap{01}{00}{CET}%
823 \DTMdefzonemap{02}{00}{CEST}%
824 }
825 % \end{macrocode}
826 %\end{macro}
827 % Switch style according to the \opt{useregional} setting.
828 % \begin{macrocode}
829 \DTMifcaseregional
830 {}% do nothing
831 {\DTMsetstyle{italian}}
832 {\DTMsetstyle{italian-numeric}}
833 % \end{macrocode}
834 %
835 % Redefine \cs{dateitalian} (or \cs{date}\meta{dialect}) to prevent
836 % \sty{babel} from resetting \cs{today}. (For this to work,
837 % \sty{babel} must already have been loaded if it's required.)
838 % \begin{macrocode}
839 \ifcsundef{date\CurrentTrackedDialect}
840 {%
841 \ifundef\dateitalian
842 {% do nothing
843 }%
844 {%
845 \def\dateitalian{%
846 \DTMifcaseregional
847 {}% do nothing
848 {\DTMsetstyle{italian}}%
849 {\DTMsetstyle{italian-numeric}}%
850 }%
851 }%
852 }%
853 {%
854 \csdef{date\CurrentTrackedDialect}{%
855 \DTMifcaseregional
856 {}% do nothing
857 {\DTMsetstyle{italian}}%
858 {\DTMsetstyle{italian-numeric}}
859 }%
860 }%
861 % \end{macrocode}
862 %\iffalse
863 % \begin{macrocode}
864 %</datetime2-italian.ldf>
865 % \end{macrocode}
866 %\fi
867 %\Finale
868 \endinput