summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx')
-rw-r--r--macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx868
1 files changed, 868 insertions, 0 deletions
diff --git a/macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx b/macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx
new file mode 100644
index 0000000000..1c194b0453
--- /dev/null
+++ b/macros/latex/contrib/datetime2-contrib/datetime2-italian/datetime2-italian.dtx
@@ -0,0 +1,868 @@
+%\iffalse
+%<*package>
+%% \CharacterTable
+%% {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
+%% 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
+%% Digits \0\1\2\3\4\5\6\7\8\9
+%% Exclamation \! Double quote \" Hash (number) \#
+%% Dollar \$ Percent \% Ampersand \&
+%% Acute accent \' Left paren \( Right paren \)
+%% Asterisk \* Plus \+ Comma \,
+%% Minus \- Point \. Solidus \/
+%% Colon \: Semicolon \; Less than \<
+%% Equals \= Greater than \> Question mark \?
+%% Commercial at \@ Left bracket \[ Backslash \\
+%% Right bracket \] Circumflex \^ Underscore \_
+%% Grave accent \` Left brace \{ Vertical bar \|
+%% Right brace \} Tilde \~}
+%</package>
+%\fi
+% \iffalse
+% Doc-Source file to use with LaTeX2e
+% Copyright (C) 2015 Nicola Talbot, all rights reserved.
+% \fi
+% \iffalse
+%<*driver>
+\documentclass{ltxdoc}
+
+\usepackage{alltt}
+\usepackage{graphicx}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage[colorlinks,
+ bookmarks,
+ hyperindex=false,
+ pdfauthor={Nicola L.C. Talbot},
+ pdftitle={datetime2.sty Italian Module}]{hyperref}
+
+
+\CheckSum{467}
+
+\renewcommand*{\usage}[1]{\hyperpage{#1}}
+\renewcommand*{\main}[1]{\hyperpage{#1}}
+\IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
+\setcounter{IndexColumns}{2}
+
+\newcommand*{\sty}[1]{\textsf{#1}}
+\newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
+
+\RecordChanges
+\PageIndex
+\CodelineNumbered
+
+\begin{document}
+\DocInput{datetime2-italian.dtx}
+\end{document}
+%</driver>
+%\fi
+%
+%\MakeShortVerb{"}
+%
+%\title{Italian Module for datetime2 Package}
+%\author{Nicola L. C. Talbot (inactive)}
+%\date{2015-05-01 (v1.3)}
+%\maketitle
+%
+% This module is currently maintained and may be subject to change.
+%
+% The Current Maintainer of this work is Claudio Duchi claduc at libero dot it
+%\begin{abstract}
+%This is the Italian language module for the \sty{datetime2}
+%package. If you want to use the settings in this module you must
+%install it in addition to installing \sty{datetime2}. If you use
+%\sty{babel} or \sty{polyglossia}, you will need this module to
+%prevent them from redefining \cs{today}. The \sty{datetime2}
+% \opt{useregional} setting must be set to "text" or "numeric"
+% for the language styles to be set.
+% Alternatively, you can set the style in the document using
+% \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
+% depending on the value of the \opt{useregional} setting.
+%\end{abstract}
+%\opt{showdow} setting.
+%
+%\StopEventually{%
+%\clearpage
+%\phantomsection
+%\addcontentsline{toc}{section}{Change History}%
+%\PrintChanges
+%\addcontentsline{toc}{section}{\indexname}%
+%\PrintIndex}
+%\section{The Code}
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-italian-utf8.ldf>
+% \end{macrocode}
+%\fi
+%\subsection{UTF-8}
+%This file contains the settings that use UTF-8 characters. This
+%file is loaded if XeLaTeX or LuaLaTeX are used. Please make sure
+%your text editor is set to UTF-8 if you want to view this code.
+%\changes{1.0}{2015-03-10}{Initial release}
+%\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
+%\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
+%\changes{1.3}{2015-05-01}{bug fif% }
+% Identify module
+% \begin{macrocode}
+\ProvidesDateTimeModule{italian-utf8}[2015/05/01 v1.3]
+% \end{macrocode}
+%\begin{macro}{\DTMitalianordinal}
+% \begin{macrocode}
+\newcommand*{\DTMitalianordinal}[1]{%
+ \number#1
+}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitalianmonthname}
+% Italian month names.
+% \begin{macrocode}
+\newcommand*{\DTMitalianmonthname}[1]{%
+ \ifcase#1
+ \or
+ gennaio%
+ \or
+ febbraio%
+ \or
+ marzo%
+ \or
+ aprile%
+ \or
+ maggio%
+ \or
+ giugno%
+ \or
+ luglio%
+ \or
+ agosto%
+ \or
+ settembre%
+ \or
+ ottobre%
+ \or
+ novembre%
+ \or
+ dicembre%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%
+%\begin{macro}{\DTMitalianweekdayname}
+%These are provided here but not currently used in the date format.
+% \begin{macrocode}
+\newcommand*{\DTMitalianweekdayname}[1]{%
+ \ifcase#1
+ lunedì%
+ \or
+ martedì%
+ \or
+ mercoledì%
+ \or
+ giovedì%
+ \or
+ venerdì%
+ \or
+ sabato%
+ \or
+ domenica%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMitalianshortmonthname}
+%short mont.
+% \begin{macrocode}
+\newcommand*{\DTMitalianshortmonthname}[1]{%
+ \ifcase#1
+ \or
+ gen.%
+ \or
+ feb.%
+ \or
+ mar.%
+ \or
+ apr.%
+ \or
+ mag.%
+ \or
+ giun.%
+ \or
+ lug.%
+ \or
+ aug.%
+ \or
+ set.%
+ \or
+ ott.%
+ \or
+ nov.%
+ \or
+ dic.%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTMitalianshortweekdayname}
+%short week day.
+% \begin{macrocode}
+\newcommand*{\DTMitalianshortweekdayname}[1]{%
+ \ifcase#1
+ lun.%
+ \or
+ mar.%
+ \or
+ mer.%
+ \or
+ gio.%
+ \or
+ ven.%
+ \or
+ sab.%
+ \or
+ dom.%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\iffalse
+% \begin{macrocode}
+%</datetime2-italian-utf8.ldf>
+% \end{macrocode}
+%\fi
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-italian-ascii.ldf>
+% \end{macrocode}
+%\fi
+%\subsection{ASCII}
+%This file contains the settings that use \LaTeX\ commands for
+%non-ASCII characters. This should be input if neither XeLaTeX nor
+%LuaLaTeX are used. Even if the user has loaded \sty{inputenc} with
+%"utf8", this file should still be used not the
+%\texttt{datetime2-italian-utf8.ldf} file as the non-ASCII
+%characters are made active in that situation and would need
+%protecting against expansion.
+%\changes{1.0}{2015-03-10}{Initial release}
+%\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
+%\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
+%\changes{1.3}{2015-05-01}{bug fif% }
+% Identify module
+% \begin{macrocode}
+\ProvidesDateTimeModule{italian-ascii}[2015/05/01 v1.3]
+% \end{macrocode}
+%
+%\begin{macro}{\DTMitalianordinal}
+% \begin{macrocode}
+\newcommand*{\DTMitalianordinal}[1]{%
+ \number#1
+}%
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitalianmonthname}
+% Italian month names.
+% \begin{macrocode}
+\newcommand*{\DTMitalianmonthname}[1]{%
+ \ifcase#1
+ \or
+ gennaio%
+ \or
+ febbraio%
+ \or
+ marzo%
+ \or
+ aprile%
+ \or
+ maggio%
+ \or
+ giugno%
+ \or
+ luglio%
+ \or
+ agosto%
+ \or
+ settembre%
+ \or
+ ottobre%
+ \or
+ novembre%
+ \or
+ dicembre%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMitalianweekdayname}
+%These are provided here but not currently used in the date format.
+% \begin{macrocode}
+\newcommand*{\DTMitalianweekdayname}[1]{%
+ \ifcase#1
+ luned\protect\`i%
+ \or
+ marted\protect\`i%
+ \or
+ mercoled\protect\`i%
+ \or
+ gioved\protect\`i%
+ \or
+ venerd\protect\`i%
+ \or
+ sabato%
+ \or
+ domenica%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%
+%\begin{macro}{\DTMitalianshortmonthname}
+%short mont.
+% \begin{macrocode}
+\newcommand*{\DTMitalianshortmonthname}[1]{%
+ \ifcase#1
+ \or
+ gen.%
+ \or
+ feb.%
+ \or
+ mar.%
+ \or
+ apr.%
+ \or
+ mag.%
+ \or
+ giun.%
+ \or
+ lug.%
+ \or
+ aug.%
+ \or
+ set.%
+ \or
+ ott.%
+ \or
+ nov.%
+ \or
+ dic.%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%\begin{macro}{\DTMitalianshortweekdayname}
+%short week day.
+% \begin{macrocode}
+\newcommand*{\DTMitalianshortweekdayname}[1]{%
+ \ifcase#1
+ lun.%
+ \or
+ mar.%
+ \or
+ mer.%
+ \or
+ gio.%
+ \or
+ ven.%
+ \or
+ sab.%
+ \or
+ dom.%
+ \fi
+}
+% \end{macrocode}
+%\end{macro}
+%
+%\iffalse
+% \begin{macrocode}
+%</datetime2-italian-ascii.ldf>
+% \end{macrocode}
+%\fi
+%
+%\subsection{Main Italian Module (\texttt{datetime2-italian.ldf})}
+%\changes{1.0}{2015-03-10}{Initial release}
+%\changes{1.1}{2015-04-10}{Add timestyle italianampm% }
+%\changes{1.2}{2015-04-16}{Add timestyle italian-twenty-four% }
+%\changes{1.3}{2015-05-01}{bug fif% }
+%
+%\iffalse
+% \begin{macrocode}
+%<*datetime2-italian.ldf>
+% \end{macrocode}
+%\fi
+%
+% Identify Module
+% \begin{macrocode}
+\ProvidesDateTimeModule{italian}[2015/05/01 v1.3]
+% \end{macrocode}
+% Need to find out if XeTeX or LuaTeX are being used.
+% \begin{macrocode}
+\RequirePackage{ifxetex,ifluatex}
+% \end{macrocode}
+% XeTeX and LuaTeX natively support UTF-8, so load
+% \texttt{italian-utf8} if either of those engines are used
+% otherwise load \texttt{italian-ascii}.
+% \begin{macrocode}
+\ifxetex
+ \RequireDateTimeModule{italian-utf8}
+\else
+ \ifluatex
+ \RequireDateTimeModule{italian-utf8}
+ \else
+ \RequireDateTimeModule{italian-ascii}
+ \fi
+\fi
+% \end{macrocode}
+%
+% Define the \texttt{italian} style.
+% The time style is the same as the "default" style
+% provided by \sty{datetime2}.
+%
+% the packet defines the styles: "italian",
+% "italian-numeric", "italianampm" and "italian-twenty-four" styles.
+%
+%This doesn't use the package wide
+% separators such as
+% \cs{dtm@datetimesep} in case other date formats are also required.
+%\begin{macro}{\DTMitaliandaymonthsep}
+% The separator between the day and month for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMitaliandaymonthsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitalianmonthyearsep}
+% The separator between the month and year for the text format.
+% \begin{macrocode}
+\newcommand*{\DTMitalianmonthyearsep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitaliandatetimesep}
+% The separator between the date and time blocks in the full format
+% (either text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMitaliandatetimesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitaliantimezonesep}
+% The separator between the time and zone blocks in the full format
+% (either text or numeric).
+% \begin{macrocode}
+\newcommand*{\DTMitaliantimezonesep}{\space}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitaliandatesep}
+% The separator for the numeric date format.
+% \begin{macrocode}
+\newcommand*{\DTMitaliandatesep}{/}
+% \end{macrocode}
+%\end{macro}
+%
+%\begin{macro}{\DTMitaliantimesep}
+% The separator for the numeric time format.
+% \begin{macrocode}
+\newcommand*{\DTMitaliantimesep}{:}
+% \end{macrocode}
+%\end{macro}
+%
+% Provide keys that can be used in \cs{DTMlangsetup} to set these
+% separators.
+% \begin{macrocode}
+\DTMdefkey{italian}{daymonthsep}{\renewcommand*{\DTMitaliandaymonthsep}{#1}}
+\DTMdefkey{italian}{monthyearsep}{\renewcommand*{\DTMitalianmonthyearsep}{#1}}
+\DTMdefkey{italian}{datetimesep}{\renewcommand*{\DTMitaliandatetimesep}{#1}}
+\DTMdefkey{italian}{timezonesep}{\renewcommand*{\DTMitaliantimezonesep}{#1}}
+\DTMdefkey{italian}{datesep}{\renewcommand*{\DTMitaliandatesep}{#1}}
+\DTMdefkey{italian}{timesep}{\renewcommand*{\DTMitaliantimesep}{#1}}
+% \end{macrocode}
+
+% Define a boolean key that determines if the shortened form
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{italian}{abbr}[true]{}
+% \end{macrocode}
+% The default is to use abbr
+% \begin{macrocode}
+\DTMsetbool{italian}{abbr}{false}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the time zone mappings
+% should be used.
+% \begin{macrocode}
+\DTMdefboolkey{italian}{mapzone}[true]{}
+% \end{macrocode}
+% The default is to use mappings.
+% \begin{macrocode}
+\DTMsetbool{italian}{mapzone}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the day of month should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{italian}{showdayofmonth}[true]{}
+% \end{macrocode}
+% The default is to show the day of month.
+% \begin{macrocode}
+\DTMsetbool{italian}{showdayofmonth}{true}
+% \end{macrocode}
+%
+% Define a boolean key that determines if the year should be
+% displayed.
+% \begin{macrocode}
+\DTMdefboolkey{italian}{showyear}[true]{}
+% \end{macrocode}
+% The default is to show the year.
+% \begin{macrocode}
+\DTMsetbool{italian}{showyear}{true}
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcommand*\DTMitalianam{am}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\DTMitalianpm{pm}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\DTMitalianmidnight{mezzanotte}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*\DTMitaliannoon{mezzogiorno}%
+% \end{macrocode}
+% \begin{macrocode}
+\newcommand*{\DTMitalianampmfmt}[1]{#1}
+% \end{macrocode}
+% Define the "italian" style. (TODO: implement day of week?)
+% \begin{macrocode}
+\DTMnewstyle
+{italian}% label
+{% date style
+% \renewcommand*{\DTMitalianfmtordsuffix}{\DTMitalianfmtordsuffix}%
+ \renewcommand*\DTMdisplaydate[4]{%
+ \ifDTMshowdow
+ \ifnum##4>-1%
+ \DTMifbool{italian}{abbr}%
+ {\DTMitalianshortweekdayname{##4}}%
+ {\DTMitalianweekdayname{##4}}%
+ \space
+ \fi
+ \fi
+ \DTMifbool{italian}{showdayofmonth}%
+ {%
+ \DTMitalianordinal{##3}%
+ \DTMitaliandaymonthsep
+ }%
+ {}%
+ \DTMifbool{italian}{abbr}%
+ {\DTMitalianshortmonthname{##2}}%
+ {\DTMitalianmonthname{##2}}%
+ \DTMifbool{italian}{showyear}%
+ {%
+ \DTMitalianmonthyearsep\number##1 % space intended
+ }%
+ {}%
+ }%
+ \renewcommand*\DTMDisplaydate[4]{%
+ \ifDTMshowdow
+ \ifnum##4>-1%
+ \DTMifbool{italian}{abbr}%
+ {\DTMitalianshortweekdayname{##4}}%
+ {\DTMitalianweekdayname{##4}}%
+ \space
+ \fi
+ \fi
+ \DTMifbool{italian}{showdayofmonth}%
+ {%
+ \DTMitalianordinal{##3}%
+ \DTMitaliandaymonthsep
+ }%
+ {}%
+ \DTMifbool{italian}{abbr}%
+ {\DTMitalianshortmonthname{##2}}%
+ {\DTMitalianmonthname{##2}}%
+ \DTMifbool{italian}{showyear}%
+ {%
+ \DTMitalianmonthyearsep\number##1 % space intended
+ }%
+ {}%
+ }%
+}%
+{% time style
+ \renewcommand*\DTMitaliantimesep{\DTMitaliantimesep}%
+ \DTMsettimestyle{default}%
+}%
+{% zone style
+ \DTMresetzones
+ \DTMitalianzonemaps
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{italian}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMitaliantimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+}%
+{% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMitaliandatetimesep
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone
+ \DTMitaliantimezonesep
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}[9]{%
+ \ifDTMshowdate
+ \DTMDisplaydate{##1}{##2}{##3}{##4}%
+ \DTMitaliandatetimesep
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone
+ \DTMitaliantimezonesep
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+}%
+% \end{macrocode}
+%
+% Define numeric style.
+% \begin{macrocode}
+\DTMnewstyle
+ {italian-numeric}% label
+ {% date style
+ \renewcommand*\DTMdisplaydate[4]{%
+ \DTMifbool{italian}{showdayofmonth}%
+ {%
+ \number##3 % space intended
+ \DTMitaliandatesep
+ }%
+ {}%
+ \number##2 % space intended
+ \DTMifbool{italian}{showyear}%
+ {%
+ \DTMitaliandatesep
+ \number##1 % space intended
+ }%
+ {}%
+ }%
+ \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
+ }%
+ {% time style
+ \renewcommand*\DTMdisplaytime[3]{%
+ \number##1
+ \DTMitaliantimesep\DTMtwodigits{##2}%
+ \ifDTMshowseconds\DTMitaliantimesep\DTMtwodigits{##3}\fi
+ }%
+ }%
+ {% zone style
+ \DTMresetzones
+ \DTMitalianzonemaps
+ \renewcommand*{\DTMdisplayzone}[2]{%
+ \DTMifbool{italian}{mapzone}%
+ {\DTMusezonemapordefault{##1}{##2}}%
+ {%
+ \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
+ \ifDTMshowzoneminutes\DTMitaliantimesep\DTMtwodigits{##2}\fi
+ }%
+ }%
+ }%
+ {% full style
+ \renewcommand*{\DTMdisplay}[9]{%
+ \ifDTMshowdate
+ \DTMdisplaydate{##1}{##2}{##3}{##4}%
+ \DTMitaliandatetimesep
+ \fi
+ \DTMdisplaytime{##5}{##6}{##7}%
+ \ifDTMshowzone
+ \DTMitaliantimezonesep
+ \DTMdisplayzone{##8}{##9}%
+ \fi
+ }%
+ \renewcommand*{\DTMDisplay}{\DTMdisplay}%
+ }
+% \end{macrocode}
+%
+% Define am pm style.
+% \begin{macrocode}
+ \DTMnewtimestyle
+ {italianampm}% label
+ {%
+ \renewcommand*\DTMdisplaytime[3]{%
+ \ifnum##2=0
+ \ifnum##1=12
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitaliannoon}}%
+ {\DTMitaliannoon}%
+ \else
+ \ifnum##1=0
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianmidnight}}%
+ {\DTMitalianmidnight}%
+ \else
+ \ifnum##1=24
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianmidnight}}%
+ {\DTMitalianmidnight}%
+ \else
+ \ifnum##1<12
+ \number##1
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianam}}%
+ {\DTMitalianam}%
+ \else
+ \number\numexpr##1-12\relax
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianpm}}%
+ {\DTMitalianpm}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \else
+ \ifnum##1<13
+ \ifnum##1=0
+ 12%
+ \else
+ \number##1
+ \fi
+ \DTMitaliantimesep\DTMtwodigits{##2}%
+ \ifnum##1=12
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianam}}%
+ {\DTMitalianpm}%
+ \else
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianam}}%
+ {\DTMitalianam}%
+ \fi
+ \else
+ \number\numexpr##1-12\relax
+ \DTMitaliantimesep\DTMtwodigits{##2}%
+ \ifnum##1=24
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianpm}}%
+ {\DTMitalianam}%
+ \else
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianpm}}%
+ {\DTMitalianpm}%
+ \fi
+ \fi
+ \fi
+ }%
+ }%
+% \end{macrocode}
+%
+% Define italian-twenty-four style.
+%
+% \begin{macrocode}
+ \DTMnewtimestyle
+ {italian-twenty-four}% label
+ {%
+ \renewcommand*\DTMdisplaytime[3]{%
+ \ifnum##2=0
+ \ifnum##1=12
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitaliannoon}}%
+ {\DTMitaliannoon}%
+ \else
+ \ifnum##1=0
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianmidnight}}%
+ {\DTMitalianmidnight}%
+ \else
+ \ifnum##1=24
+ \DTMtexorpdfstring
+ {\DTMitalianampmfmt{\DTMitalianmidnight}}%
+ {\DTMitalianmidnight}%
+ \else
+ \ifnum##1<12
+ \DTMtwodigits{##1}\DTMitaliantimesep\DTMtwodigits{##2}%
+ \else
+ \DTMtwodigits{##1}\DTMitaliantimesep\DTMtwodigits{##2}%
+ \fi
+ \fi
+ \fi
+ \fi
+ \else
+ \ifnum##1<13
+ \ifnum##1=0
+ \DTMtwodigits{##1}%
+ \else
+ \DTMtwodigits{##1}\relax
+ \fi
+ \DTMitaliantimesep\DTMtwodigits{##2}%
+ \else
+ \DTMtwodigits{##1}\relax
+ \DTMitaliantimesep\DTMtwodigits{##2}%
+ \fi
+ \fi
+ }%
+ }%
+% \end{macrocode}
+%
+%
+%\begin{macro}{\DTMitalianzonemaps}
+% The time zone mappings are set through this command, which can be
+% redefined if extra mappings are required or mappings need to be
+% removed.
+% \begin{macrocode}
+\newcommand*{\DTMitalianzonemaps}{%
+ \DTMdefzonemap{01}{00}{CET}%
+ \DTMdefzonemap{02}{00}{CEST}%
+}
+% \end{macrocode}
+%\end{macro}
+% Switch style according to the \opt{useregional} setting.
+% \begin{macrocode}
+\DTMifcaseregional
+{}% do nothing
+{\DTMsetstyle{italian}}
+{\DTMsetstyle{italian-numeric}}
+% \end{macrocode}
+%
+% Redefine \cs{dateitalian} (or \cs{date}\meta{dialect}) to prevent
+% \sty{babel} from resetting \cs{today}. (For this to work,
+% \sty{babel} must already have been loaded if it's required.)
+% \begin{macrocode}
+\ifcsundef{date\CurrentTrackedDialect}
+{%
+ \ifundef\dateitalian
+ {% do nothing
+ }%
+ {%
+ \def\dateitalian{%
+ \DTMifcaseregional
+ {}% do nothing
+ {\DTMsetstyle{italian}}%
+ {\DTMsetstyle{italian-numeric}}%
+ }%
+ }%
+}%
+{%
+ \csdef{date\CurrentTrackedDialect}{%
+ \DTMifcaseregional
+ {}% do nothing
+ {\DTMsetstyle{italian}}%
+ {\DTMsetstyle{italian-numeric}}
+ }%
+}%
+% \end{macrocode}
+%\iffalse
+% \begin{macrocode}
+%</datetime2-italian.ldf>
+% \end{macrocode}
+%\fi
+%\Finale
+\endinput