%\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 \~} % %\fi % \iffalse % Doc-Source file to use with LaTeX2e % Copyright (C) 2018 Nicola Talbot, all rights reserved. % (New maintainer add relevant lines here.) % \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 Irish Module}]{hyperref} \CheckSum{552} \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-irish.dtx} \end{document} % %\fi % %\MakeShortVerb{"} % %\title{Irish Module for datetime2 Package} %\author{Nicola L. C. Talbot (inactive)} %\date{2018-04-24 (v1.1)} %\maketitle % %This module is currently unmaintained and may be subject to change. %If you want to volunteer to take over maintanance, contact me at %\url{http://www.dickimaw-books.com/contact.html} % %\begin{abstract} %This is the Irish 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} % %I've copied the date style from \texttt{babel-irish}'s \cs{today}. % %I don't know if these settings are correct as I can't speak Gaelic. %In particular, I don't know if the "irish" time style is %correct. Currently this just uses the "default" time style. Please %be aware that this may change. Whoever takes over maintanance %of this module may can change it as appropriate. % %The new maintainer should add the line: %\begin{verbatim} % The Current Maintainer of this work is Name. %\end{verbatim} %to the preamble part in \texttt{datetime2-irish.ins} where Name %is the name of the maintainer(s) and replace %the `inactive' status to `maintained'. % %Regional styles are named in the form \texttt{\meta{language %code}-\meta{country code}} (or \texttt{\meta{language %code}-\meta{country code}-numeric}) where \meta{language code} is %the ISO 639-1 language code (\texttt{ga} in the case of Irish %Gaelic) and \meta{country code} is the ISO 3166-1 country code %(\texttt{IE} for the Republic of Ireland and \texttt{GB} for the %United Kingdom of Great Britain and Northern Ireland). You will %need \sty{tracklang} v1.2 for the "ga-IE" and "ga-GB" options. %The only difference between them is the Summer time zone mappings %with IST (Irish Summer Time) for "ga-IE" and BST (British Summer %Time) for "ga-GB". The regionless "irish" style uses WET (Western %European Time) and WEST (Western European Summer Time). % %\StopEventually{% %\clearpage %\phantomsection %\addcontentsline{toc}{section}{Change History}% %\PrintChanges %\addcontentsline{toc}{section}{\indexname}% %\PrintIndex} %\section{The Code} %\iffalse % \begin{macrocode} %<*datetime2-irish-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-26}{Initial release} % Identify module % \begin{macrocode} \ProvidesDateTimeModule{irish-utf8}[2018/04/24 v1.1] % \end{macrocode} %\begin{macro}{\DTMirishordinal} % I don't know if this is correct, but it's provided in case % a suffix is required. % \begin{macrocode} \newcommand*{\DTMirishordinal}[1]{% \number#1 % space intended } % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishmonthname} % Irish month names. % \begin{macrocode} \newcommand*{\DTMirishmonthname}[1]{% \ifcase#1 \or Eanáir% \or Feabhra% \or Márta% \or Aibreán% \or Bealtaine% \or Meitheamh% \or Iúil% \or Lúnasa% \or Meán Fómhair% \or Deireadh Fómhair% \or Mí na Samhna% \or Mí na Nollag% \fi } % \end{macrocode} %\end{macro} % %If abbreviated dates are supported, short month names should be %likewise provided. % %\iffalse % \begin{macrocode} % % \end{macrocode} %\fi %\iffalse % \begin{macrocode} %<*datetime2-irish-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-irish-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-26}{Initial release} % Identify module % \begin{macrocode} \ProvidesDateTimeModule{irish-ascii}[2018/04/24 v1.1] % \end{macrocode} %\begin{macro}{\DTMirishordinal} % I don't know if this is correct, but it's provided in case % a suffix is required. % \begin{macrocode} \newcommand*{\DTMirishordinal}[1]{% \number#1 % space intended } % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishmonthname} % Irish month names. % \begin{macrocode} \newcommand*{\DTMirishmonthname}[1]{% \ifcase#1 \or Ean\protect\'air% \or Feabhra% \or M\protect\'arta% \or Aibre\protect\'an% \or Bealtaine% \or Meitheamh% \or I\protect\'uil% \or L\protect\'unasa% \or Me\protect\'an F\protect\'omhair% \or Deireadh F\protect\'omhair% \or M\protect\'i na Samhna% \or M\protect\'i na Nollag% \fi } % \end{macrocode} %\end{macro} % %If abbreviated dates are supported, short month names should be %likewise provided. % %\iffalse % \begin{macrocode} % % \end{macrocode} %\fi % %\subsection{Irish (no region) Module (\texttt{datetime2-irish.ldf})} %\changes{1.0}{2015-03-26}{Initial release} % %\iffalse % \begin{macrocode} %<*datetime2-irish.ldf> % \end{macrocode} %\fi % % Identify Module % \begin{macrocode} \ProvidesDateTimeModule{irish}[2018/04/24 v1.1] % \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{irish-utf8} if either of those engines are used % otherwise load \texttt{irish-ascii}. % \begin{macrocode} \ifxetex \RequireDateTimeModule{irish-utf8} \else \ifluatex \RequireDateTimeModule{irish-utf8} \else \RequireDateTimeModule{irish-ascii} \fi \fi % \end{macrocode} % % Define the \texttt{irish} style. % The time style is the same as the "default" style % provided by \sty{datetime2}. This may need correcting. For % example, if a 12 hour style similar to the "englishampm" (from the % "english-base" module) is required. % % Allow the user a way of configuring the "irish" and % "irish-numeric" styles. This doesn't use the package wide % separators such as % \cs{dtm@datetimesep} in case other date formats are also required. %\begin{macro}{\DTMirishdaymonthsep} % The separator between the day and month for the text format. % \begin{macrocode} \newcommand*{\DTMirishdaymonthsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishmonthyearsep} % The separator between the month and year for the text format. % \begin{macrocode} \newcommand*{\DTMirishmonthyearsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishdatetimesep} % The separator between the date and time blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMirishdatetimesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishtimezonesep} % The separator between the time and zone blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMirishtimezonesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishdatesep} % The separator for the numeric date format. % \begin{macrocode} \newcommand*{\DTMirishdatesep}{/} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMirishtimesep} % The separator for the numeric time format. % \begin{macrocode} \newcommand*{\DTMirishtimesep}{:} % \end{macrocode} %\end{macro} % %Provide keys that can be used in \cs{DTMlangsetup} to set these %separators. % \begin{macrocode} \DTMdefkey{irish}{daymonthsep}{\renewcommand*{\DTMirishdaymonthsep}{#1}} \DTMdefkey{irish}{monthyearsep}{\renewcommand*{\DTMirishmonthyearsep}{#1}} \DTMdefkey{irish}{datetimesep}{\renewcommand*{\DTMirishdatetimesep}{#1}} \DTMdefkey{irish}{timezonesep}{\renewcommand*{\DTMirishtimezonesep}{#1}} \DTMdefkey{irish}{datesep}{\renewcommand*{\DTMirishdatesep}{#1}} \DTMdefkey{irish}{timesep}{\renewcommand*{\DTMirishtimesep}{#1}} % \end{macrocode} % % TODO: provide a boolean key to switch between full and abbreviated % formats if appropriate. (I don't know how the date should be % abbreviated.) % % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} \DTMdefboolkey{irish}{mapzone}[true]{} % \end{macrocode} % The default is to use mappings. % \begin{macrocode} \DTMsetbool{irish}{mapzone}{true} % \end{macrocode} % % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} \DTMdefboolkey{irish}{showdayofmonth}[true]{} % \end{macrocode} % The default is to show the day of month. % \begin{macrocode} \DTMsetbool{irish}{showdayofmonth}{true} % \end{macrocode} % % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} \DTMdefboolkey{irish}{showyear}[true]{} % \end{macrocode} % The default is to show the year. % \begin{macrocode} \DTMsetbool{irish}{showyear}{true} % \end{macrocode} % % Define the "irish" style. (TODO: implement day of week?) % \begin{macrocode} \DTMnewstyle {irish}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{irish}{showdayofmonth} {\DTMirishordinal{##3}\DTMirishdaymonthsep}% {}% \DTMirishmonthname{##2}% \DTMifbool{irish}{showyear}% {% \DTMirishmonthyearsep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% }% {% time style (use default) \DTMsettimestyle{default}% }% {% zone style \DTMresetzones \DTMirishzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{irish}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMirishtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMirishdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMirishtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% }% % \end{macrocode} % % Define numeric style. % \begin{macrocode} \DTMnewstyle {irish-numeric}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{irish}{showdayofmonth}% {% \number##3 % space intended \DTMirishdatesep }% {}% \number##2 % space intended \DTMifbool{irish}{showyear}% {% \DTMirishdatesep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}% }% {% time style \renewcommand*\DTMdisplaytime[3]{% \number##1 \DTMirishtimesep\DTMtwodigits{##2}% \ifDTMshowseconds\DTMirishtimesep\DTMtwodigits{##3}\fi }% }% {% zone style \DTMresetzones \DTMirishzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{irish}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMirishtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMirishdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMirishtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% } % \end{macrocode} % %\begin{macro}{\DTMirishzonemaps} % The time zone mappings are set through this command, which can be % redefined if extra mappings are required or mappings need to be % removed. Since no region is provided, this style uses WET/WEST % time zone mappings. % \begin{macrocode} \newcommand*{\DTMirishzonemaps}{% \DTMdefzonemap{00}{00}{WET}% \DTMdefzonemap{01}{00}{WEST}% } % \end{macrocode} %\end{macro} % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional {}% do nothing {\DTMsetstyle{irish}} {\DTMsetstyle{irish-numeric}} % \end{macrocode} % % Redefine \cs{dateirish} (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.) %\changes{1.1}{2018-04-24}{removed spurious space} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% \ifundef\dateirish {% do nothing }% {% \def\dateirish{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{irish}}% {\DTMsetstyle{irish-numeric}}% }% }% }% {% \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{irish}}% {\DTMsetstyle{irish-numeric}}% }% }% % \end{macrocode} %\iffalse % \begin{macrocode} % % \end{macrocode} %\fi %\subsection{Irish (Republic of Ireland) Module (\texttt{datetime2-ga-IE.ldf})} %\changes{1.0}{2015-03-26}{Initial release} % As "irish" but uses different time zone mappings. %\iffalse % \begin{macrocode} %<*datetime2-ga-IE.ldf> % \end{macrocode} %\fi % % Identify Module % \begin{macrocode} \ProvidesDateTimeModule{ga-IE}[2018/04/24 v1.1] % \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{irish-utf8} if either of those engines are used % otherwise load \texttt{irish-ascii}. % \begin{macrocode} \ifxetex \RequireDateTimeModule{irish-utf8} \else \ifluatex \RequireDateTimeModule{irish-utf8} \else \RequireDateTimeModule{irish-ascii} \fi \fi % \end{macrocode} % % Define the \texttt{ga-IE} style. % The time style is the same as the "default" style % provided by \sty{datetime2}. This may need correcting. For % example, if a 12 hour style similar to the "englishampm" (from the % "english-base" module) is required. % % Allow the user a way of configuring the "ga-IE" and % "ga-IE-numeric" styles. This doesn't use the package wide % separators such as % \cs{dtm@datetimesep} in case other date formats are also required. %\begin{macro}{\DTMgaIEdaymonthsep} % The separator between the day and month for the text format. % \begin{macrocode} \newcommand*{\DTMgaIEdaymonthsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaIEmonthyearsep} % The separator between the month and year for the text format. % \begin{macrocode} \newcommand*{\DTMgaIEmonthyearsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaIEdatetimesep} % The separator between the date and time blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMgaIEdatetimesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaIEtimezonesep} % The separator between the time and zone blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMgaIEtimezonesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaIEdatesep} % The separator for the numeric date format. % \begin{macrocode} \newcommand*{\DTMgaIEdatesep}{/} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaIEtimesep} % The separator for the numeric time format. % \begin{macrocode} \newcommand*{\DTMgaIEtimesep}{:} % \end{macrocode} %\end{macro} % %Provide keys that can be used in \cs{DTMlangsetup} to set these %separators. % \begin{macrocode} \DTMdefkey{ga-IE}{daymonthsep}{\renewcommand*{\DTMgaIEdaymonthsep}{#1}} \DTMdefkey{ga-IE}{monthyearsep}{\renewcommand*{\DTMgaIEmonthyearsep}{#1}} \DTMdefkey{ga-IE}{datetimesep}{\renewcommand*{\DTMgaIEdatetimesep}{#1}} \DTMdefkey{ga-IE}{timezonesep}{\renewcommand*{\DTMgaIEtimezonesep}{#1}} \DTMdefkey{ga-IE}{datesep}{\renewcommand*{\DTMgaIEdatesep}{#1}} \DTMdefkey{ga-IE}{timesep}{\renewcommand*{\DTMgaIEtimesep}{#1}} % \end{macrocode} % % TODO: provide a boolean key to switch between full and abbreviated % formats if appropriate. (I don't know how the date should be % abbreviated.) % % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} \DTMdefboolkey{ga-IE}{mapzone}[true]{} % \end{macrocode} % The default is to use mappings. % \begin{macrocode} \DTMsetbool{ga-IE}{mapzone}{true} % \end{macrocode} % % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} \DTMdefboolkey{ga-IE}{showdayofmonth}[true]{} % \end{macrocode} % The default is to show the day of month. % \begin{macrocode} \DTMsetbool{ga-IE}{showdayofmonth}{true} % \end{macrocode} % % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} \DTMdefboolkey{ga-IE}{showyear}[true]{} % \end{macrocode} % The default is to show the year. % \begin{macrocode} \DTMsetbool{ga-IE}{showyear}{true} % \end{macrocode} % % Define the "ga-IE" style. (TODO: implement day of week?) % \begin{macrocode} \DTMnewstyle {ga-IE}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{ga-IE}{showdayofmonth} {\DTMirishordinal{##3}\DTMgaIEdaymonthsep}% {}% \DTMirishmonthname{##2}% \DTMifbool{ga-IE}{showyear}% {% \DTMgaIEmonthyearsep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% }% {% time style (use default) \DTMsettimestyle{default}% }% {% zone style \DTMresetzones \DTMgaIEzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{ga-IE}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMgaIEtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMgaIEdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMgaIEtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% }% % \end{macrocode} % % Define numeric style. % \begin{macrocode} \DTMnewstyle {ga-IE-numeric}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{ga-IE}{showdayofmonth}% {% \number##3 % space intended \DTMgaIEdatesep }% {}% \number##2 % space intended \DTMifbool{ga-IE}{showyear}% {% \DTMgaIEdatesep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}% }% {% time style \renewcommand*\DTMdisplaytime[3]{% \number##1 \DTMgaIEtimesep\DTMtwodigits{##2}% \ifDTMshowseconds\DTMgaIEtimesep\DTMtwodigits{##3}\fi }% }% {% zone style \DTMresetzones \DTMgaIEzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{ga-IE}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMgaIEtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMgaIEdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMgaIEtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% } % \end{macrocode} % %\begin{macro}{\DTMgaIEzonemaps} % 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*{\DTMgaIEzonemaps}{% \DTMdefzonemap{00}{00}{GMT}% \DTMdefzonemap{01}{00}{IST}% } % \end{macrocode} %\end{macro} % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-IE}} {\DTMsetstyle{ga-IE-numeric}} % \end{macrocode} % % Redefine \cs{dateirish} (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.) %\changes{1.1}{2018-04-24}{removed spurious space} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% \ifundef\dateirish {% do nothing }% {% \def\dateirish{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-IE}}% {\DTMsetstyle{ga-IE-numeric}}% }% }% }% {% \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-IE}}% {\DTMsetstyle{ga-IE-numeric}}% }% }% % \end{macrocode} %\iffalse % \begin{macrocode} % % \end{macrocode} %\fi %\subsection{Irish (Northern Ireland) Module (\texttt{datetime2-ga-GB.ldf})} %\changes{1.0}{2015-03-26}{Initial release} % As "irish" but uses different time zone mappings. %\iffalse % \begin{macrocode} %<*datetime2-ga-GB.ldf> % \end{macrocode} %\fi % % Identify Module % \begin{macrocode} \ProvidesDateTimeModule{ga-GB}[2018/04/24 v1.1] % \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{irish-utf8} if either of those engines are used % otherwise load \texttt{irish-ascii}. % \begin{macrocode} \ifxetex \RequireDateTimeModule{irish-utf8} \else \ifluatex \RequireDateTimeModule{irish-utf8} \else \RequireDateTimeModule{irish-ascii} \fi \fi % \end{macrocode} % % Define the \texttt{ga-GB} style. % The time style is the same as the "default" style % provided by \sty{datetime2}. This may need correcting. For % example, if a 12 hour style similar to the "englishampm" (from the % "english-base" module) is required. % % Allow the user a way of configuring the "ga-GB" and % "ga-GB-numeric" styles. This doesn't use the package wide % separators such as % \cs{dtm@datetimesep} in case other date formats are also required. %\begin{macro}{\DTMgaGBdaymonthsep} % The separator between the day and month for the text format. % \begin{macrocode} \newcommand*{\DTMgaGBdaymonthsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaGBmonthyearsep} % The separator between the month and year for the text format. % \begin{macrocode} \newcommand*{\DTMgaGBmonthyearsep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaGBdatetimesep} % The separator between the date and time blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMgaGBdatetimesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaGBtimezonesep} % The separator between the time and zone blocks in the full format % (either text or numeric). % \begin{macrocode} \newcommand*{\DTMgaGBtimezonesep}{\space} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaGBdatesep} % The separator for the numeric date format. % \begin{macrocode} \newcommand*{\DTMgaGBdatesep}{/} % \end{macrocode} %\end{macro} % %\begin{macro}{\DTMgaGBtimesep} % The separator for the numeric time format. % \begin{macrocode} \newcommand*{\DTMgaGBtimesep}{:} % \end{macrocode} %\end{macro} % %Provide keys that can be used in \cs{DTMlangsetup} to set these %separators. % \begin{macrocode} \DTMdefkey{ga-GB}{daymonthsep}{\renewcommand*{\DTMgaGBdaymonthsep}{#1}} \DTMdefkey{ga-GB}{monthyearsep}{\renewcommand*{\DTMgaGBmonthyearsep}{#1}} \DTMdefkey{ga-GB}{datetimesep}{\renewcommand*{\DTMgaGBdatetimesep}{#1}} \DTMdefkey{ga-GB}{timezonesep}{\renewcommand*{\DTMgaGBtimezonesep}{#1}} \DTMdefkey{ga-GB}{datesep}{\renewcommand*{\DTMgaGBdatesep}{#1}} \DTMdefkey{ga-GB}{timesep}{\renewcommand*{\DTMgaGBtimesep}{#1}} % \end{macrocode} % % TODO: provide a boolean key to switch between full and abbreviated % formats if appropriate. (I don't know how the date should be % abbreviated.) % % Define a boolean key that determines if the time zone mappings % should be used. % \begin{macrocode} \DTMdefboolkey{ga-GB}{mapzone}[true]{} % \end{macrocode} % The default is to use mappings. % \begin{macrocode} \DTMsetbool{ga-GB}{mapzone}{true} % \end{macrocode} % % Define a boolean key that determines if the day of month should be % displayed. % \begin{macrocode} \DTMdefboolkey{ga-GB}{showdayofmonth}[true]{} % \end{macrocode} % The default is to show the day of month. % \begin{macrocode} \DTMsetbool{ga-GB}{showdayofmonth}{true} % \end{macrocode} % % Define a boolean key that determines if the year should be % displayed. % \begin{macrocode} \DTMdefboolkey{ga-GB}{showyear}[true]{} % \end{macrocode} % The default is to show the year. % \begin{macrocode} \DTMsetbool{ga-GB}{showyear}{true} % \end{macrocode} % % Define the "ga-GB" style. (TODO: implement day of week?) % \begin{macrocode} \DTMnewstyle {ga-GB}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{ga-GB}{showdayofmonth} {\DTMirishordinal{##3}\DTMgaGBdaymonthsep}% {}% \DTMirishmonthname{##2}% \DTMifbool{ga-GB}{showyear}% {% \DTMgaGBmonthyearsep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% }% {% time style (use default) \DTMsettimestyle{default}% }% {% zone style \DTMresetzones \DTMgaGBzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{ga-GB}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMgaGBtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMgaGBdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMgaGBtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% }% % \end{macrocode} % % Define numeric style. % \begin{macrocode} \DTMnewstyle {ga-GB-numeric}% label {% date style \renewcommand*\DTMdisplaydate[4]{% \DTMifbool{ga-GB}{showdayofmonth}% {% \number##3 % space intended \DTMgaGBdatesep }% {}% \number##2 % space intended \DTMifbool{ga-GB}{showyear}% {% \DTMgaGBdatesep \number##1 % space intended }% {}% }% \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}% }% {% time style \renewcommand*\DTMdisplaytime[3]{% \number##1 \DTMgaGBtimesep\DTMtwodigits{##2}% \ifDTMshowseconds\DTMgaGBtimesep\DTMtwodigits{##3}\fi }% }% {% zone style \DTMresetzones \DTMgaGBzonemaps \renewcommand*{\DTMdisplayzone}[2]{% \DTMifbool{ga-GB}{mapzone}% {\DTMusezonemapordefault{##1}{##2}}% {% \ifnum##1<0\else+\fi\DTMtwodigits{##1}% \ifDTMshowzoneminutes\DTMgaGBtimesep\DTMtwodigits{##2}\fi }% }% }% {% full style \renewcommand*{\DTMdisplay}[9]{% \ifDTMshowdate \DTMdisplaydate{##1}{##2}{##3}{##4}% \DTMgaGBdatetimesep \fi \DTMdisplaytime{##5}{##6}{##7}% \ifDTMshowzone \DTMgaGBtimezonesep \DTMdisplayzone{##8}{##9}% \fi }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% } % \end{macrocode} % %\begin{macro}{\DTMgaGBzonemaps} % 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*{\DTMgaGBzonemaps}{% \DTMdefzonemap{00}{00}{GMT}% \DTMdefzonemap{01}{00}{BST}% } % \end{macrocode} %\end{macro} % Switch style according to the \opt{useregional} setting. % \begin{macrocode} \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-GB}} {\DTMsetstyle{ga-GB-numeric}} % \end{macrocode} % % Redefine \cs{dateirish} (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.) %\changes{1.1}{2018-04-24}{removed spurious space} % \begin{macrocode} \ifcsundef{date\CurrentTrackedDialect} {% \ifundef\dateirish {% do nothing }% {% \def\dateirish{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-GB}}% {\DTMsetstyle{ga-GB-numeric}}% }% }% }% {% \csdef{date\CurrentTrackedDialect}{% \DTMifcaseregional {}% do nothing {\DTMsetstyle{ga-GB}}% {\DTMsetstyle{ga-GB-numeric}}% }% }% % \end{macrocode} %\iffalse % \begin{macrocode} % % \end{macrocode} %\fi %\Finale \endinput