Debian Codegraph @

texmf-dist/source/latex/datetime2-irish/datetime2-irish.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) 2018 Nicola Talbot, all rights reserved.
23 % (New maintainer add relevant lines here.)
24 % \fi
25 % \iffalse
26 %<*driver>
27 \documentclass{ltxdoc}
28
29 \usepackage{alltt}
30 \usepackage{graphicx}
31 \usepackage[utf8]{inputenc}
32 \usepackage[T1]{fontenc}
33 \usepackage[colorlinks,
34 bookmarks,
35 hyperindex=false,
36 pdfauthor={Nicola L.C. Talbot},
37 pdftitle={datetime2.sty Irish Module}]{hyperref}
38
39
40 \CheckSum{552}
41
42 \renewcommand*{\usage}[1]{\hyperpage{#1}}
43 \renewcommand*{\main}[1]{\hyperpage{#1}}
44 \IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
45 \setcounter{IndexColumns}{2}
46
47 \newcommand*{\sty}[1]{\textsf{#1}}
48 \newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
49
50 \RecordChanges
51 \PageIndex
52 \CodelineNumbered
53
54 \begin{document}
55 \DocInput{datetime2-irish.dtx}
56 \end{document}
57 %</driver>
58 %\fi
59 %
60 %\MakeShortVerb{"}
61 %
62 %\title{Irish Module for datetime2 Package}
63 %\author{Nicola L. C. Talbot (inactive)}
64 %\date{2018-04-24 (v1.1)}
65 %\maketitle
66 %
67 %This module is currently unmaintained and may be subject to change.
68 %If you want to volunteer to take over maintanance, contact me at
69 %\url{http://www.dickimaw-books.com/contact.html}
70 %
71 %\begin{abstract}
72 %This is the Irish language module for the \sty{datetime2}
73 %package. If you want to use the settings in this module you must
74 %install it in addition to installing \sty{datetime2}. If you use
75 %\sty{babel} or \sty{polyglossia}, you will need this module to
76 %prevent them from redefining \cs{today}. The \sty{datetime2}
77 % \opt{useregional} setting must be set to "text" or "numeric"
78 % for the language styles to be set.
79 % Alternatively, you can set the style in the document using
80 % \cs{DTMsetstyle}, but this may be changed by \cs{date}\meta{language}
81 % depending on the value of the \opt{useregional} setting.
82 %\end{abstract}
83 %
84 %I've copied the date style from \texttt{babel-irish}'s \cs{today}.
85 %
86 %I don't know if these settings are correct as I can't speak Gaelic.
87 %In particular, I don't know if the "irish" time style is
88 %correct. Currently this just uses the "default" time style. Please
89 %be aware that this may change. Whoever takes over maintanance
90 %of this module may can change it as appropriate.
91 %
92 %The new maintainer should add the line:
93 %\begin{verbatim}
94 % The Current Maintainer of this work is Name.
95 %\end{verbatim}
96 %to the preamble part in \texttt{datetime2-irish.ins} where Name
97 %is the name of the maintainer(s) and replace
98 %the `inactive' status to `maintained'.
99 %
100 %Regional styles are named in the form \texttt{\meta{language
101 %code}-\meta{country code}} (or \texttt{\meta{language
102 %code}-\meta{country code}-numeric}) where \meta{language code} is
103 %the ISO 639-1 language code (\texttt{ga} in the case of Irish
104 %Gaelic) and \meta{country code} is the ISO 3166-1 country code
105 %(\texttt{IE} for the Republic of Ireland and \texttt{GB} for the
106 %United Kingdom of Great Britain and Northern Ireland). You will
107 %need \sty{tracklang} v1.2 for the "ga-IE" and "ga-GB" options.
108 %The only difference between them is the Summer time zone mappings
109 %with IST (Irish Summer Time) for "ga-IE" and BST (British Summer
110 %Time) for "ga-GB". The regionless "irish" style uses WET (Western
111 %European Time) and WEST (Western European Summer Time).
112 %
113 %\StopEventually{%
114 %\clearpage
115 %\phantomsection
116 %\addcontentsline{toc}{section}{Change History}%
117 %\PrintChanges
118 %\addcontentsline{toc}{section}{\indexname}%
119 %\PrintIndex}
120 %\section{The Code}
121 %\iffalse
122 % \begin{macrocode}
123 %<*datetime2-irish-utf8.ldf>
124 % \end{macrocode}
125 %\fi
126 %\subsection{UTF-8}
127 %This file contains the settings that use UTF-8 characters. This
128 %file is loaded if XeLaTeX or LuaLaTeX are used. Please make sure
129 %your text editor is set to UTF-8 if you want to view this code.
130 %\changes{1.0}{2015-03-26}{Initial release}
131 % Identify module
132 % \begin{macrocode}
133 \ProvidesDateTimeModule{irish-utf8}[2018/04/24 v1.1]
134 % \end{macrocode}
135 %\begin{macro}{\DTMirishordinal}
136 % I don't know if this is correct, but it's provided in case
137 % a suffix is required.
138 % \begin{macrocode}
139 \newcommand*{\DTMirishordinal}[1]{%
140 \number#1 % space intended
141 }
142 % \end{macrocode}
143 %\end{macro}
144 %
145 %\begin{macro}{\DTMirishmonthname}
146 % Irish month names.
147 % \begin{macrocode}
148 \newcommand*{\DTMirishmonthname}[1]{%
149 \ifcase#1
150 \or
151 Eanáir%
152 \or
153 Feabhra%
154 \or
155 Márta%
156 \or
157 Aibreán%
158 \or
159 Bealtaine%
160 \or
161 Meitheamh%
162 \or
163 Iúil%
164 \or
165 Lúnasa%
166 \or
167 Meán Fómhair%
168 \or
169 Deireadh Fómhair%
170 \or
171 Mí na Samhna%
172 \or
173 Mí na Nollag%
174 \fi
175 }
176 % \end{macrocode}
177 %\end{macro}
178 %
179 %If abbreviated dates are supported, short month names should be
180 %likewise provided.
181 %
182 %\iffalse
183 % \begin{macrocode}
184 %</datetime2-irish-utf8.ldf>
185 % \end{macrocode}
186 %\fi
187 %\iffalse
188 % \begin{macrocode}
189 %<*datetime2-irish-ascii.ldf>
190 % \end{macrocode}
191 %\fi
192 %\subsection{ASCII}
193 %This file contains the settings that use \LaTeX\ commands for
194 %non-ASCII characters. This should be input if neither XeLaTeX nor
195 %LuaLaTeX are used. Even if the user has loaded \sty{inputenc} with
196 %"utf8", this file should still be used not the
197 %\texttt{datetime2-irish-utf8.ldf} file as the non-ASCII
198 %characters are made active in that situation and would need
199 %protecting against expansion.
200 %\changes{1.0}{2015-03-26}{Initial release}
201 % Identify module
202 % \begin{macrocode}
203 \ProvidesDateTimeModule{irish-ascii}[2018/04/24 v1.1]
204 % \end{macrocode}
205 %\begin{macro}{\DTMirishordinal}
206 % I don't know if this is correct, but it's provided in case
207 % a suffix is required.
208 % \begin{macrocode}
209 \newcommand*{\DTMirishordinal}[1]{%
210 \number#1 % space intended
211 }
212 % \end{macrocode}
213 %\end{macro}
214 %
215 %\begin{macro}{\DTMirishmonthname}
216 % Irish month names.
217 % \begin{macrocode}
218 \newcommand*{\DTMirishmonthname}[1]{%
219 \ifcase#1
220 \or
221 Ean\protect\'air%
222 \or
223 Feabhra%
224 \or
225 M\protect\'arta%
226 \or
227 Aibre\protect\'an%
228 \or
229 Bealtaine%
230 \or
231 Meitheamh%
232 \or
233 I\protect\'uil%
234 \or
235 L\protect\'unasa%
236 \or
237 Me\protect\'an F\protect\'omhair%
238 \or
239 Deireadh F\protect\'omhair%
240 \or
241 M\protect\'i na Samhna%
242 \or
243 M\protect\'i na Nollag%
244 \fi
245 }
246 % \end{macrocode}
247 %\end{macro}
248 %
249 %If abbreviated dates are supported, short month names should be
250 %likewise provided.
251 %
252 %\iffalse
253 % \begin{macrocode}
254 %</datetime2-irish-ascii.ldf>
255 % \end{macrocode}
256 %\fi
257 %
258 %\subsection{Irish (no region) Module (\texttt{datetime2-irish.ldf})}
259 %\changes{1.0}{2015-03-26}{Initial release}
260 %
261 %\iffalse
262 % \begin{macrocode}
263 %<*datetime2-irish.ldf>
264 % \end{macrocode}
265 %\fi
266 %
267 % Identify Module
268 % \begin{macrocode}
269 \ProvidesDateTimeModule{irish}[2018/04/24 v1.1]
270 % \end{macrocode}
271 % Need to find out if XeTeX or LuaTeX are being used.
272 % \begin{macrocode}
273 \RequirePackage{ifxetex,ifluatex}
274 % \end{macrocode}
275 % XeTeX and LuaTeX natively support UTF-8, so load
276 % \texttt{irish-utf8} if either of those engines are used
277 % otherwise load \texttt{irish-ascii}.
278 % \begin{macrocode}
279 \ifxetex
280 \RequireDateTimeModule{irish-utf8}
281 \else
282 \ifluatex
283 \RequireDateTimeModule{irish-utf8}
284 \else
285 \RequireDateTimeModule{irish-ascii}
286 \fi
287 \fi
288 % \end{macrocode}
289 %
290 % Define the \texttt{irish} style.
291 % The time style is the same as the "default" style
292 % provided by \sty{datetime2}. This may need correcting. For
293 % example, if a 12 hour style similar to the "englishampm" (from the
294 % "english-base" module) is required.
295 %
296 % Allow the user a way of configuring the "irish" and
297 % "irish-numeric" styles. This doesn't use the package wide
298 % separators such as
299 % \cs{dtm@datetimesep} in case other date formats are also required.
300 %\begin{macro}{\DTMirishdaymonthsep}
301 % The separator between the day and month for the text format.
302 % \begin{macrocode}
303 \newcommand*{\DTMirishdaymonthsep}{\space}
304 % \end{macrocode}
305 %\end{macro}
306 %
307 %\begin{macro}{\DTMirishmonthyearsep}
308 % The separator between the month and year for the text format.
309 % \begin{macrocode}
310 \newcommand*{\DTMirishmonthyearsep}{\space}
311 % \end{macrocode}
312 %\end{macro}
313 %
314 %\begin{macro}{\DTMirishdatetimesep}
315 % The separator between the date and time blocks in the full format
316 % (either text or numeric).
317 % \begin{macrocode}
318 \newcommand*{\DTMirishdatetimesep}{\space}
319 % \end{macrocode}
320 %\end{macro}
321 %
322 %\begin{macro}{\DTMirishtimezonesep}
323 % The separator between the time and zone blocks in the full format
324 % (either text or numeric).
325 % \begin{macrocode}
326 \newcommand*{\DTMirishtimezonesep}{\space}
327 % \end{macrocode}
328 %\end{macro}
329 %
330 %\begin{macro}{\DTMirishdatesep}
331 % The separator for the numeric date format.
332 % \begin{macrocode}
333 \newcommand*{\DTMirishdatesep}{/}
334 % \end{macrocode}
335 %\end{macro}
336 %
337 %\begin{macro}{\DTMirishtimesep}
338 % The separator for the numeric time format.
339 % \begin{macrocode}
340 \newcommand*{\DTMirishtimesep}{:}
341 % \end{macrocode}
342 %\end{macro}
343 %
344 %Provide keys that can be used in \cs{DTMlangsetup} to set these
345 %separators.
346 % \begin{macrocode}
347 \DTMdefkey{irish}{daymonthsep}{\renewcommand*{\DTMirishdaymonthsep}{#1}}
348 \DTMdefkey{irish}{monthyearsep}{\renewcommand*{\DTMirishmonthyearsep}{#1}}
349 \DTMdefkey{irish}{datetimesep}{\renewcommand*{\DTMirishdatetimesep}{#1}}
350 \DTMdefkey{irish}{timezonesep}{\renewcommand*{\DTMirishtimezonesep}{#1}}
351 \DTMdefkey{irish}{datesep}{\renewcommand*{\DTMirishdatesep}{#1}}
352 \DTMdefkey{irish}{timesep}{\renewcommand*{\DTMirishtimesep}{#1}}
353 % \end{macrocode}
354 %
355 % TODO: provide a boolean key to switch between full and abbreviated
356 % formats if appropriate. (I don't know how the date should be
357 % abbreviated.)
358 %
359 % Define a boolean key that determines if the time zone mappings
360 % should be used.
361 % \begin{macrocode}
362 \DTMdefboolkey{irish}{mapzone}[true]{}
363 % \end{macrocode}
364 % The default is to use mappings.
365 % \begin{macrocode}
366 \DTMsetbool{irish}{mapzone}{true}
367 % \end{macrocode}
368 %
369 % Define a boolean key that determines if the day of month should be
370 % displayed.
371 % \begin{macrocode}
372 \DTMdefboolkey{irish}{showdayofmonth}[true]{}
373 % \end{macrocode}
374 % The default is to show the day of month.
375 % \begin{macrocode}
376 \DTMsetbool{irish}{showdayofmonth}{true}
377 % \end{macrocode}
378 %
379 % Define a boolean key that determines if the year should be
380 % displayed.
381 % \begin{macrocode}
382 \DTMdefboolkey{irish}{showyear}[true]{}
383 % \end{macrocode}
384 % The default is to show the year.
385 % \begin{macrocode}
386 \DTMsetbool{irish}{showyear}{true}
387 % \end{macrocode}
388 %
389 % Define the "irish" style. (TODO: implement day of week?)
390 % \begin{macrocode}
391 \DTMnewstyle
392 {irish}% label
393 {% date style
394 \renewcommand*\DTMdisplaydate[4]{%
395 \DTMifbool{irish}{showdayofmonth}
396 {\DTMirishordinal{##3}\DTMirishdaymonthsep}%
397 {}%
398 \DTMirishmonthname{##2}%
399 \DTMifbool{irish}{showyear}%
400 {%
401 \DTMirishmonthyearsep
402 \number##1 % space intended
403 }%
404 {}%
405 }%
406 \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
407 }%
408 {% time style (use default)
409 \DTMsettimestyle{default}%
410 }%
411 {% zone style
412 \DTMresetzones
413 \DTMirishzonemaps
414 \renewcommand*{\DTMdisplayzone}[2]{%
415 \DTMifbool{irish}{mapzone}%
416 {\DTMusezonemapordefault{##1}{##2}}%
417 {%
418 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
419 \ifDTMshowzoneminutes\DTMirishtimesep\DTMtwodigits{##2}\fi
420 }%
421 }%
422 }%
423 {% full style
424 \renewcommand*{\DTMdisplay}[9]{%
425 \ifDTMshowdate
426 \DTMdisplaydate{##1}{##2}{##3}{##4}%
427 \DTMirishdatetimesep
428 \fi
429 \DTMdisplaytime{##5}{##6}{##7}%
430 \ifDTMshowzone
431 \DTMirishtimezonesep
432 \DTMdisplayzone{##8}{##9}%
433 \fi
434 }%
435 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
436 }%
437 % \end{macrocode}
438 %
439 % Define numeric style.
440 % \begin{macrocode}
441 \DTMnewstyle
442 {irish-numeric}% label
443 {% date style
444 \renewcommand*\DTMdisplaydate[4]{%
445 \DTMifbool{irish}{showdayofmonth}%
446 {%
447 \number##3 % space intended
448 \DTMirishdatesep
449 }%
450 {}%
451 \number##2 % space intended
452 \DTMifbool{irish}{showyear}%
453 {%
454 \DTMirishdatesep
455 \number##1 % space intended
456 }%
457 {}%
458 }%
459 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
460 }%
461 {% time style
462 \renewcommand*\DTMdisplaytime[3]{%
463 \number##1
464 \DTMirishtimesep\DTMtwodigits{##2}%
465 \ifDTMshowseconds\DTMirishtimesep\DTMtwodigits{##3}\fi
466 }%
467 }%
468 {% zone style
469 \DTMresetzones
470 \DTMirishzonemaps
471 \renewcommand*{\DTMdisplayzone}[2]{%
472 \DTMifbool{irish}{mapzone}%
473 {\DTMusezonemapordefault{##1}{##2}}%
474 {%
475 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
476 \ifDTMshowzoneminutes\DTMirishtimesep\DTMtwodigits{##2}\fi
477 }%
478 }%
479 }%
480 {% full style
481 \renewcommand*{\DTMdisplay}[9]{%
482 \ifDTMshowdate
483 \DTMdisplaydate{##1}{##2}{##3}{##4}%
484 \DTMirishdatetimesep
485 \fi
486 \DTMdisplaytime{##5}{##6}{##7}%
487 \ifDTMshowzone
488 \DTMirishtimezonesep
489 \DTMdisplayzone{##8}{##9}%
490 \fi
491 }%
492 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
493 }
494 % \end{macrocode}
495 %
496 %\begin{macro}{\DTMirishzonemaps}
497 % The time zone mappings are set through this command, which can be
498 % redefined if extra mappings are required or mappings need to be
499 % removed. Since no region is provided, this style uses WET/WEST
500 % time zone mappings.
501 % \begin{macrocode}
502 \newcommand*{\DTMirishzonemaps}{%
503 \DTMdefzonemap{00}{00}{WET}%
504 \DTMdefzonemap{01}{00}{WEST}%
505 }
506 % \end{macrocode}
507 %\end{macro}
508
509 % Switch style according to the \opt{useregional} setting.
510 % \begin{macrocode}
511 \DTMifcaseregional
512 {}% do nothing
513 {\DTMsetstyle{irish}}
514 {\DTMsetstyle{irish-numeric}}
515 % \end{macrocode}
516 %
517 % Redefine \cs{dateirish} (or \cs{date}\meta{dialect}) to prevent
518 % \sty{babel} from resetting \cs{today}. (For this to work,
519 % \sty{babel} must already have been loaded if it's required.)
520 %\changes{1.1}{2018-04-24}{removed spurious space}
521 % \begin{macrocode}
522 \ifcsundef{date\CurrentTrackedDialect}
523 {%
524 \ifundef\dateirish
525 {% do nothing
526 }%
527 {%
528 \def\dateirish{%
529 \DTMifcaseregional
530 {}% do nothing
531 {\DTMsetstyle{irish}}%
532 {\DTMsetstyle{irish-numeric}}%
533 }%
534 }%
535 }%
536 {%
537 \csdef{date\CurrentTrackedDialect}{%
538 \DTMifcaseregional
539 {}% do nothing
540 {\DTMsetstyle{irish}}%
541 {\DTMsetstyle{irish-numeric}}%
542 }%
543 }%
544 % \end{macrocode}
545 %\iffalse
546 % \begin{macrocode}
547 %</datetime2-irish.ldf>
548 % \end{macrocode}
549 %\fi
550 %\subsection{Irish (Republic of Ireland) Module (\texttt{datetime2-ga-IE.ldf})}
551 %\changes{1.0}{2015-03-26}{Initial release}
552 % As "irish" but uses different time zone mappings.
553 %\iffalse
554 % \begin{macrocode}
555 %<*datetime2-ga-IE.ldf>
556 % \end{macrocode}
557 %\fi
558 %
559 % Identify Module
560 % \begin{macrocode}
561 \ProvidesDateTimeModule{ga-IE}[2018/04/24 v1.1]
562 % \end{macrocode}
563 % Need to find out if XeTeX or LuaTeX are being used.
564 % \begin{macrocode}
565 \RequirePackage{ifxetex,ifluatex}
566 % \end{macrocode}
567 % XeTeX and LuaTeX natively support UTF-8, so load
568 % \texttt{irish-utf8} if either of those engines are used
569 % otherwise load \texttt{irish-ascii}.
570 % \begin{macrocode}
571 \ifxetex
572 \RequireDateTimeModule{irish-utf8}
573 \else
574 \ifluatex
575 \RequireDateTimeModule{irish-utf8}
576 \else
577 \RequireDateTimeModule{irish-ascii}
578 \fi
579 \fi
580 % \end{macrocode}
581 %
582 % Define the \texttt{ga-IE} style.
583 % The time style is the same as the "default" style
584 % provided by \sty{datetime2}. This may need correcting. For
585 % example, if a 12 hour style similar to the "englishampm" (from the
586 % "english-base" module) is required.
587 %
588 % Allow the user a way of configuring the "ga-IE" and
589 % "ga-IE-numeric" styles. This doesn't use the package wide
590 % separators such as
591 % \cs{dtm@datetimesep} in case other date formats are also required.
592 %\begin{macro}{\DTMgaIEdaymonthsep}
593 % The separator between the day and month for the text format.
594 % \begin{macrocode}
595 \newcommand*{\DTMgaIEdaymonthsep}{\space}
596 % \end{macrocode}
597 %\end{macro}
598 %
599 %\begin{macro}{\DTMgaIEmonthyearsep}
600 % The separator between the month and year for the text format.
601 % \begin{macrocode}
602 \newcommand*{\DTMgaIEmonthyearsep}{\space}
603 % \end{macrocode}
604 %\end{macro}
605 %
606 %\begin{macro}{\DTMgaIEdatetimesep}
607 % The separator between the date and time blocks in the full format
608 % (either text or numeric).
609 % \begin{macrocode}
610 \newcommand*{\DTMgaIEdatetimesep}{\space}
611 % \end{macrocode}
612 %\end{macro}
613 %
614 %\begin{macro}{\DTMgaIEtimezonesep}
615 % The separator between the time and zone blocks in the full format
616 % (either text or numeric).
617 % \begin{macrocode}
618 \newcommand*{\DTMgaIEtimezonesep}{\space}
619 % \end{macrocode}
620 %\end{macro}
621 %
622 %\begin{macro}{\DTMgaIEdatesep}
623 % The separator for the numeric date format.
624 % \begin{macrocode}
625 \newcommand*{\DTMgaIEdatesep}{/}
626 % \end{macrocode}
627 %\end{macro}
628 %
629 %\begin{macro}{\DTMgaIEtimesep}
630 % The separator for the numeric time format.
631 % \begin{macrocode}
632 \newcommand*{\DTMgaIEtimesep}{:}
633 % \end{macrocode}
634 %\end{macro}
635 %
636 %Provide keys that can be used in \cs{DTMlangsetup} to set these
637 %separators.
638 % \begin{macrocode}
639 \DTMdefkey{ga-IE}{daymonthsep}{\renewcommand*{\DTMgaIEdaymonthsep}{#1}}
640 \DTMdefkey{ga-IE}{monthyearsep}{\renewcommand*{\DTMgaIEmonthyearsep}{#1}}
641 \DTMdefkey{ga-IE}{datetimesep}{\renewcommand*{\DTMgaIEdatetimesep}{#1}}
642 \DTMdefkey{ga-IE}{timezonesep}{\renewcommand*{\DTMgaIEtimezonesep}{#1}}
643 \DTMdefkey{ga-IE}{datesep}{\renewcommand*{\DTMgaIEdatesep}{#1}}
644 \DTMdefkey{ga-IE}{timesep}{\renewcommand*{\DTMgaIEtimesep}{#1}}
645 % \end{macrocode}
646 %
647 % TODO: provide a boolean key to switch between full and abbreviated
648 % formats if appropriate. (I don't know how the date should be
649 % abbreviated.)
650 %
651 % Define a boolean key that determines if the time zone mappings
652 % should be used.
653 % \begin{macrocode}
654 \DTMdefboolkey{ga-IE}{mapzone}[true]{}
655 % \end{macrocode}
656 % The default is to use mappings.
657 % \begin{macrocode}
658 \DTMsetbool{ga-IE}{mapzone}{true}
659 % \end{macrocode}
660 %
661 % Define a boolean key that determines if the day of month should be
662 % displayed.
663 % \begin{macrocode}
664 \DTMdefboolkey{ga-IE}{showdayofmonth}[true]{}
665 % \end{macrocode}
666 % The default is to show the day of month.
667 % \begin{macrocode}
668 \DTMsetbool{ga-IE}{showdayofmonth}{true}
669 % \end{macrocode}
670 %
671 % Define a boolean key that determines if the year should be
672 % displayed.
673 % \begin{macrocode}
674 \DTMdefboolkey{ga-IE}{showyear}[true]{}
675 % \end{macrocode}
676 % The default is to show the year.
677 % \begin{macrocode}
678 \DTMsetbool{ga-IE}{showyear}{true}
679 % \end{macrocode}
680 %
681 % Define the "ga-IE" style. (TODO: implement day of week?)
682 % \begin{macrocode}
683 \DTMnewstyle
684 {ga-IE}% label
685 {% date style
686 \renewcommand*\DTMdisplaydate[4]{%
687 \DTMifbool{ga-IE}{showdayofmonth}
688 {\DTMirishordinal{##3}\DTMgaIEdaymonthsep}%
689 {}%
690 \DTMirishmonthname{##2}%
691 \DTMifbool{ga-IE}{showyear}%
692 {%
693 \DTMgaIEmonthyearsep
694 \number##1 % space intended
695 }%
696 {}%
697 }%
698 \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
699 }%
700 {% time style (use default)
701 \DTMsettimestyle{default}%
702 }%
703 {% zone style
704 \DTMresetzones
705 \DTMgaIEzonemaps
706 \renewcommand*{\DTMdisplayzone}[2]{%
707 \DTMifbool{ga-IE}{mapzone}%
708 {\DTMusezonemapordefault{##1}{##2}}%
709 {%
710 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
711 \ifDTMshowzoneminutes\DTMgaIEtimesep\DTMtwodigits{##2}\fi
712 }%
713 }%
714 }%
715 {% full style
716 \renewcommand*{\DTMdisplay}[9]{%
717 \ifDTMshowdate
718 \DTMdisplaydate{##1}{##2}{##3}{##4}%
719 \DTMgaIEdatetimesep
720 \fi
721 \DTMdisplaytime{##5}{##6}{##7}%
722 \ifDTMshowzone
723 \DTMgaIEtimezonesep
724 \DTMdisplayzone{##8}{##9}%
725 \fi
726 }%
727 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
728 }%
729 % \end{macrocode}
730 %
731 % Define numeric style.
732 % \begin{macrocode}
733 \DTMnewstyle
734 {ga-IE-numeric}% label
735 {% date style
736 \renewcommand*\DTMdisplaydate[4]{%
737 \DTMifbool{ga-IE}{showdayofmonth}%
738 {%
739 \number##3 % space intended
740 \DTMgaIEdatesep
741 }%
742 {}%
743 \number##2 % space intended
744 \DTMifbool{ga-IE}{showyear}%
745 {%
746 \DTMgaIEdatesep
747 \number##1 % space intended
748 }%
749 {}%
750 }%
751 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
752 }%
753 {% time style
754 \renewcommand*\DTMdisplaytime[3]{%
755 \number##1
756 \DTMgaIEtimesep\DTMtwodigits{##2}%
757 \ifDTMshowseconds\DTMgaIEtimesep\DTMtwodigits{##3}\fi
758 }%
759 }%
760 {% zone style
761 \DTMresetzones
762 \DTMgaIEzonemaps
763 \renewcommand*{\DTMdisplayzone}[2]{%
764 \DTMifbool{ga-IE}{mapzone}%
765 {\DTMusezonemapordefault{##1}{##2}}%
766 {%
767 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
768 \ifDTMshowzoneminutes\DTMgaIEtimesep\DTMtwodigits{##2}\fi
769 }%
770 }%
771 }%
772 {% full style
773 \renewcommand*{\DTMdisplay}[9]{%
774 \ifDTMshowdate
775 \DTMdisplaydate{##1}{##2}{##3}{##4}%
776 \DTMgaIEdatetimesep
777 \fi
778 \DTMdisplaytime{##5}{##6}{##7}%
779 \ifDTMshowzone
780 \DTMgaIEtimezonesep
781 \DTMdisplayzone{##8}{##9}%
782 \fi
783 }%
784 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
785 }
786 % \end{macrocode}
787 %
788 %\begin{macro}{\DTMgaIEzonemaps}
789 % The time zone mappings are set through this command, which can be
790 % redefined if extra mappings are required or mappings need to be
791 % removed.
792 % \begin{macrocode}
793 \newcommand*{\DTMgaIEzonemaps}{%
794 \DTMdefzonemap{00}{00}{GMT}%
795 \DTMdefzonemap{01}{00}{IST}%
796 }
797 % \end{macrocode}
798 %\end{macro}
799
800 % Switch style according to the \opt{useregional} setting.
801 % \begin{macrocode}
802 \DTMifcaseregional
803 {}% do nothing
804 {\DTMsetstyle{ga-IE}}
805 {\DTMsetstyle{ga-IE-numeric}}
806 % \end{macrocode}
807 %
808 % Redefine \cs{dateirish} (or \cs{date}\meta{dialect}) to prevent
809 % \sty{babel} from resetting \cs{today}. (For this to work,
810 % \sty{babel} must already have been loaded if it's required.)
811 %\changes{1.1}{2018-04-24}{removed spurious space}
812 % \begin{macrocode}
813 \ifcsundef{date\CurrentTrackedDialect}
814 {%
815 \ifundef\dateirish
816 {% do nothing
817 }%
818 {%
819 \def\dateirish{%
820 \DTMifcaseregional
821 {}% do nothing
822 {\DTMsetstyle{ga-IE}}%
823 {\DTMsetstyle{ga-IE-numeric}}%
824 }%
825 }%
826 }%
827 {%
828 \csdef{date\CurrentTrackedDialect}{%
829 \DTMifcaseregional
830 {}% do nothing
831 {\DTMsetstyle{ga-IE}}%
832 {\DTMsetstyle{ga-IE-numeric}}%
833 }%
834 }%
835 % \end{macrocode}
836 %\iffalse
837 % \begin{macrocode}
838 %</datetime2-ga-IE.ldf>
839 % \end{macrocode}
840 %\fi
841 %\subsection{Irish (Northern Ireland) Module (\texttt{datetime2-ga-GB.ldf})}
842 %\changes{1.0}{2015-03-26}{Initial release}
843 % As "irish" but uses different time zone mappings.
844 %\iffalse
845 % \begin{macrocode}
846 %<*datetime2-ga-GB.ldf>
847 % \end{macrocode}
848 %\fi
849 %
850 % Identify Module
851 % \begin{macrocode}
852 \ProvidesDateTimeModule{ga-GB}[2018/04/24 v1.1]
853 % \end{macrocode}
854 % Need to find out if XeTeX or LuaTeX are being used.
855 % \begin{macrocode}
856 \RequirePackage{ifxetex,ifluatex}
857 % \end{macrocode}
858 % XeTeX and LuaTeX natively support UTF-8, so load
859 % \texttt{irish-utf8} if either of those engines are used
860 % otherwise load \texttt{irish-ascii}.
861 % \begin{macrocode}
862 \ifxetex
863 \RequireDateTimeModule{irish-utf8}
864 \else
865 \ifluatex
866 \RequireDateTimeModule{irish-utf8}
867 \else
868 \RequireDateTimeModule{irish-ascii}
869 \fi
870 \fi
871 % \end{macrocode}
872 %
873 % Define the \texttt{ga-GB} style.
874 % The time style is the same as the "default" style
875 % provided by \sty{datetime2}. This may need correcting. For
876 % example, if a 12 hour style similar to the "englishampm" (from the
877 % "english-base" module) is required.
878 %
879 % Allow the user a way of configuring the "ga-GB" and
880 % "ga-GB-numeric" styles. This doesn't use the package wide
881 % separators such as
882 % \cs{dtm@datetimesep} in case other date formats are also required.
883 %\begin{macro}{\DTMgaGBdaymonthsep}
884 % The separator between the day and month for the text format.
885 % \begin{macrocode}
886 \newcommand*{\DTMgaGBdaymonthsep}{\space}
887 % \end{macrocode}
888 %\end{macro}
889 %
890 %\begin{macro}{\DTMgaGBmonthyearsep}
891 % The separator between the month and year for the text format.
892 % \begin{macrocode}
893 \newcommand*{\DTMgaGBmonthyearsep}{\space}
894 % \end{macrocode}
895 %\end{macro}
896 %
897 %\begin{macro}{\DTMgaGBdatetimesep}
898 % The separator between the date and time blocks in the full format
899 % (either text or numeric).
900 % \begin{macrocode}
901 \newcommand*{\DTMgaGBdatetimesep}{\space}
902 % \end{macrocode}
903 %\end{macro}
904 %
905 %\begin{macro}{\DTMgaGBtimezonesep}
906 % The separator between the time and zone blocks in the full format
907 % (either text or numeric).
908 % \begin{macrocode}
909 \newcommand*{\DTMgaGBtimezonesep}{\space}
910 % \end{macrocode}
911 %\end{macro}
912 %
913 %\begin{macro}{\DTMgaGBdatesep}
914 % The separator for the numeric date format.
915 % \begin{macrocode}
916 \newcommand*{\DTMgaGBdatesep}{/}
917 % \end{macrocode}
918 %\end{macro}
919 %
920 %\begin{macro}{\DTMgaGBtimesep}
921 % The separator for the numeric time format.
922 % \begin{macrocode}
923 \newcommand*{\DTMgaGBtimesep}{:}
924 % \end{macrocode}
925 %\end{macro}
926 %
927 %Provide keys that can be used in \cs{DTMlangsetup} to set these
928 %separators.
929 % \begin{macrocode}
930 \DTMdefkey{ga-GB}{daymonthsep}{\renewcommand*{\DTMgaGBdaymonthsep}{#1}}
931 \DTMdefkey{ga-GB}{monthyearsep}{\renewcommand*{\DTMgaGBmonthyearsep}{#1}}
932 \DTMdefkey{ga-GB}{datetimesep}{\renewcommand*{\DTMgaGBdatetimesep}{#1}}
933 \DTMdefkey{ga-GB}{timezonesep}{\renewcommand*{\DTMgaGBtimezonesep}{#1}}
934 \DTMdefkey{ga-GB}{datesep}{\renewcommand*{\DTMgaGBdatesep}{#1}}
935 \DTMdefkey{ga-GB}{timesep}{\renewcommand*{\DTMgaGBtimesep}{#1}}
936 % \end{macrocode}
937 %
938 % TODO: provide a boolean key to switch between full and abbreviated
939 % formats if appropriate. (I don't know how the date should be
940 % abbreviated.)
941 %
942 % Define a boolean key that determines if the time zone mappings
943 % should be used.
944 % \begin{macrocode}
945 \DTMdefboolkey{ga-GB}{mapzone}[true]{}
946 % \end{macrocode}
947 % The default is to use mappings.
948 % \begin{macrocode}
949 \DTMsetbool{ga-GB}{mapzone}{true}
950 % \end{macrocode}
951 %
952 % Define a boolean key that determines if the day of month should be
953 % displayed.
954 % \begin{macrocode}
955 \DTMdefboolkey{ga-GB}{showdayofmonth}[true]{}
956 % \end{macrocode}
957 % The default is to show the day of month.
958 % \begin{macrocode}
959 \DTMsetbool{ga-GB}{showdayofmonth}{true}
960 % \end{macrocode}
961 %
962 % Define a boolean key that determines if the year should be
963 % displayed.
964 % \begin{macrocode}
965 \DTMdefboolkey{ga-GB}{showyear}[true]{}
966 % \end{macrocode}
967 % The default is to show the year.
968 % \begin{macrocode}
969 \DTMsetbool{ga-GB}{showyear}{true}
970 % \end{macrocode}
971 %
972 % Define the "ga-GB" style. (TODO: implement day of week?)
973 % \begin{macrocode}
974 \DTMnewstyle
975 {ga-GB}% label
976 {% date style
977 \renewcommand*\DTMdisplaydate[4]{%
978 \DTMifbool{ga-GB}{showdayofmonth}
979 {\DTMirishordinal{##3}\DTMgaGBdaymonthsep}%
980 {}%
981 \DTMirishmonthname{##2}%
982 \DTMifbool{ga-GB}{showyear}%
983 {%
984 \DTMgaGBmonthyearsep
985 \number##1 % space intended
986 }%
987 {}%
988 }%
989 \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}%
990 }%
991 {% time style (use default)
992 \DTMsettimestyle{default}%
993 }%
994 {% zone style
995 \DTMresetzones
996 \DTMgaGBzonemaps
997 \renewcommand*{\DTMdisplayzone}[2]{%
998 \DTMifbool{ga-GB}{mapzone}%
999 {\DTMusezonemapordefault{##1}{##2}}%
1000 {%
1001 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
1002 \ifDTMshowzoneminutes\DTMgaGBtimesep\DTMtwodigits{##2}\fi
1003 }%
1004 }%
1005 }%
1006 {% full style
1007 \renewcommand*{\DTMdisplay}[9]{%
1008 \ifDTMshowdate
1009 \DTMdisplaydate{##1}{##2}{##3}{##4}%
1010 \DTMgaGBdatetimesep
1011 \fi
1012 \DTMdisplaytime{##5}{##6}{##7}%
1013 \ifDTMshowzone
1014 \DTMgaGBtimezonesep
1015 \DTMdisplayzone{##8}{##9}%
1016 \fi
1017 }%
1018 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
1019 }%
1020 % \end{macrocode}
1021 %
1022 % Define numeric style.
1023 % \begin{macrocode}
1024 \DTMnewstyle
1025 {ga-GB-numeric}% label
1026 {% date style
1027 \renewcommand*\DTMdisplaydate[4]{%
1028 \DTMifbool{ga-GB}{showdayofmonth}%
1029 {%
1030 \number##3 % space intended
1031 \DTMgaGBdatesep
1032 }%
1033 {}%
1034 \number##2 % space intended
1035 \DTMifbool{ga-GB}{showyear}%
1036 {%
1037 \DTMgaGBdatesep
1038 \number##1 % space intended
1039 }%
1040 {}%
1041 }%
1042 \renewcommand*{\DTMDisplaydate}[4]{\DTMdisplaydate{##1}{##2}{##3}{##4}}%
1043 }%
1044 {% time style
1045 \renewcommand*\DTMdisplaytime[3]{%
1046 \number##1
1047 \DTMgaGBtimesep\DTMtwodigits{##2}%
1048 \ifDTMshowseconds\DTMgaGBtimesep\DTMtwodigits{##3}\fi
1049 }%
1050 }%
1051 {% zone style
1052 \DTMresetzones
1053 \DTMgaGBzonemaps
1054 \renewcommand*{\DTMdisplayzone}[2]{%
1055 \DTMifbool{ga-GB}{mapzone}%
1056 {\DTMusezonemapordefault{##1}{##2}}%
1057 {%
1058 \ifnum##1<0\else+\fi\DTMtwodigits{##1}%
1059 \ifDTMshowzoneminutes\DTMgaGBtimesep\DTMtwodigits{##2}\fi
1060 }%
1061 }%
1062 }%
1063 {% full style
1064 \renewcommand*{\DTMdisplay}[9]{%
1065 \ifDTMshowdate
1066 \DTMdisplaydate{##1}{##2}{##3}{##4}%
1067 \DTMgaGBdatetimesep
1068 \fi
1069 \DTMdisplaytime{##5}{##6}{##7}%
1070 \ifDTMshowzone
1071 \DTMgaGBtimezonesep
1072 \DTMdisplayzone{##8}{##9}%
1073 \fi
1074 }%
1075 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
1076 }
1077 % \end{macrocode}
1078 %
1079 %\begin{macro}{\DTMgaGBzonemaps}
1080 % The time zone mappings are set through this command, which can be
1081 % redefined if extra mappings are required or mappings need to be
1082 % removed.
1083 % \begin{macrocode}
1084 \newcommand*{\DTMgaGBzonemaps}{%
1085 \DTMdefzonemap{00}{00}{GMT}%
1086 \DTMdefzonemap{01}{00}{BST}%
1087 }
1088 % \end{macrocode}
1089 %\end{macro}
1090
1091 % Switch style according to the \opt{useregional} setting.
1092 % \begin{macrocode}
1093 \DTMifcaseregional
1094 {}% do nothing
1095 {\DTMsetstyle{ga-GB}}
1096 {\DTMsetstyle{ga-GB-numeric}}
1097 % \end{macrocode}
1098 %
1099 % Redefine \cs{dateirish} (or \cs{date}\meta{dialect}) to prevent
1100 % \sty{babel} from resetting \cs{today}. (For this to work,
1101 % \sty{babel} must already have been loaded if it's required.)
1102 %\changes{1.1}{2018-04-24}{removed spurious space}
1103 % \begin{macrocode}
1104 \ifcsundef{date\CurrentTrackedDialect}
1105 {%
1106 \ifundef\dateirish
1107 {% do nothing
1108 }%
1109 {%
1110 \def\dateirish{%
1111 \DTMifcaseregional
1112 {}% do nothing
1113 {\DTMsetstyle{ga-GB}}%
1114 {\DTMsetstyle{ga-GB-numeric}}%
1115 }%
1116 }%
1117 }%
1118 {%
1119 \csdef{date\CurrentTrackedDialect}{%
1120 \DTMifcaseregional
1121 {}% do nothing
1122 {\DTMsetstyle{ga-GB}}%
1123 {\DTMsetstyle{ga-GB-numeric}}%
1124 }%
1125 }%
1126 % \end{macrocode}
1127 %\iffalse
1128 % \begin{macrocode}
1129 %</datetime2-ga-GB.ldf>
1130 % \end{macrocode}
1131 %\fi
1132 %\Finale
1133 \endinput