Debian Codegraph @

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