Debian Codegraph @

texmf-dist/source/latex/datetime2-serbian/datetime2-serbian.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) 2019 Nicola Talbot, all rights reserved.
23 % Copyright (C) 2019 Andrej Radović, all rights reserved.
24 % \fi
25 % \iffalse
26 %<*driver>
27 \documentclass[11pt]{ltxdoc}
28 \CheckSum{3809}
29
30 \usepackage[utf8]{inputenc}
31 \usepackage[T1]{fontenc}
32 \usepackage{fontspec}
33
34 \usepackage{hologo}
35 \usepackage{graphicx}
36 \usepackage{multicol}
37 \usepackage[dvipsnames]{xcolor}
38 \usepackage[english]{babel}
39 \usepackage[colorlinks,
40 %draft, % hyperref's draft mode - disable all hypertext
41 % TOC settings
42 %
43 bookmarks,
44 linktocpage=true, % make page number, not text, be link on TOC
45 %
46 % link colors and other settings
47 pageanchor=true,% give every page an anchor in its top left corner
48 % necessary for many other options
49 plainpages=false,% don't force Arabic anchor naming
50 breaklinks=true,% allow breaking links over lines
51 colorlinks=true,% enable link coloring
52 urlcolor=Maroon,% url colors
53 linkcolor=MidnightBlue,% color for normal, internal links
54 citecolor=PineGreen,% bibliographical citation color
55 %frenchlinks=true % use small caps instead of color for links
56 %pdfborder={1 0 0},% the color of boxes around links if colorlinks is
57 % not used
58 %
59 % PDF settings
60 %
61 unicode=true, % set PDF metadata to be unicode
62 pdfpagemode=UseNone, % don't open either bookmark or thumbnail sidebar
63 % alternately, UseOutlines shows bookmark sidebar
64 pdfstartview=FitV, % scale the PDF to fit the height on first open
65 bookmarksnumbered=true,% include section number in bookmarks
66 bookmarksopen=true,% expand bookmark tree in PDF viewer to a level
67 bookmarksopenlevel=1,% this is the level
68 hypertexnames=true, % guessable link names
69 pdfhighlight=/O,% links are outlined when selected, not /I for inverted
70 %
71 % PDF metadata
72 %
73 pdftitle={datetime2.sty Serbian Module}
74 pdfauthor={Andrej Radović},
75 pdfcreator={xdvipdfmx},%
76 pdfproducer={lualatex},%
77 hyperindex=false%
78 ]{hyperref}
79 \usepackage{textcase}
80
81 \usepackage{enumitem}
82 \newlist{flushenumerate}{enumerate}{2}
83 \setlist[flushenumerate]{nosep,after=\vspace{\baselineskip}}
84 \setlist[flushenumerate, 1]{leftmargin=0pt, label=\arabic*}
85 \setlist[flushenumerate, 2]{leftmargin=*}
86 \newlist{optdescription}{description}{1}
87 \setlist[optdescription]{%
88 align=right,
89 labelindent=!,
90 leftmargin=0pt,
91 font=\small\normalfont\ttfamily}
92
93 \usepackage{acronym}
94 \renewcommand{\acsfont}[1]{{\scshape{#1}}}
95 \renewcommand*{\aclabelfont}[1]{{\acsfont{#1}}}
96
97 \renewcommand*{\usage}[1]{\hyperpage{#1}}
98 \renewcommand*{\main}[1]{\hyperpage{#1}}
99 \IndexPrologue{\section*{\indexname}\markboth{\indexname}{\indexname}}
100 \setcounter{IndexColumns}{2}
101 \setcounter{GlossaryColumns}{2}
102 \setlength{\columnsep}{2em}
103 \let\GlossaryParms\IndexParms%
104 \newcommand*{\indexitemst}[1]{{\bfseries\sffamily\normalsize{#1}}}
105
106 \newcommand*{\sty}[1]{{\textsf{#1}}}
107 \newcommand*{\opt}[1]{\texttt{#1}\index{#1=\texttt{#1}|main}}
108 \newcommand*{\subsubsectionopt}[1]{\subsubsection{#1}\index{#1=\texttt{#1}|main
109 }}
110 \newcommand*{\itemopt}[1]{\item[#1]\index{#1=\texttt{#1}|main}}
111
112 \usepackage[final,tracking=true, protrusion=true, expansion=true]{microtype}
113
114 \usepackage[drafting=false,
115 tocaligned=false,
116 dottedtoc=false,
117 eulerchapternumbers=false,
118 linedheaders=false,
119 floatperchapter=false,
120 eulermath=false,
121 beramono=false,
122 palatino=false,
123 style=arsclassica,
124 nochapters=true%
125 ]{classicthesis}
126
127 \pagestyle{plain}
128 \cfoot[\small\pagemark]{}% use a small centered page number in the footer
129 \ofoot[]{}% clear the outer footer
130
131 \usepackage[%showframe,
132 top=3.25cm, bottom=3cm, marginpar=2cm]{geometry}
133
134 \defaultfontfeatures{Ligatures=TeX, Scale=MatchLowercase}
135 \setmainfont{XCharter}[Numbers=OldStyle]
136 \setmonofont{Inconsolata LGC}
137 \setsansfont{Fira Sans Book}[%
138 Numbers=OldStyle,
139 ItalicFont = {Fira Sans Book Italic},
140 BoldFont = {Fira Sans SemiBold},
141 BoldItalicFont = {Fira Sans SemiBold Italic}]
142 \newfontfamily\cyrillicfont{XCharter}
143
144 \RecordChanges%
145 \PageIndex%
146 \CodelineNumbered%
147
148 \begin{document}
149 \DocInput{datetime2-serbian.dtx}
150 \end{document}
151 %</driver>
152 %\fi
153 %
154 %\MakeShortVerb{"}
155 %
156 %\changes{2.0.0}{2019-11-07}{%
157 % Restyled the documentation.
158 %}
159 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
160 %
161 %
162 %\title{{\rmfamily\normalfont\spacedallcaps{%
163 % Serbian Module for datetime\liningnums{2} Package}}\\%
164 % {\large\url{https://gitlab.com/andrejr/datetime2-serbian}}}
165 %\author{%
166 % \spacedlowsmallcaps{Andrej Radović}\\
167 % \url{[email protected]}
168 % \and
169 % \spacedlowsmallcaps{Nicola L. C. Talbot} \\
170 % {\textsf{(inactive)}}
171 %}
172 %\date{{\sffamily\scshape 2019-11-22 (v2.1.0)}}
173 %\maketitle
174 %
175 % \renewcommand{\abstractname}{\normalfont\normalsize\spacedlowsmallcaps{Abstract}}
176 %
177 %
178 %\begin{abstract}
179 %\noindent
180 %This is the Serbian language module for the \sty{datetime2}
181 %package. If you want to use the settings in this module you must
182 %install it in addition to installing \sty{datetime2}. If you use
183 %\sty{babel} or \sty{polyglossia}, you will need this module to
184 %prevent them from redefining \cs{today}. The \sty{datetime2}
185 % \opt{useregional} setting must be on (\texttt{text} or
186 % \texttt{numeric}) for the language styles to be set.
187 % Alternatively, you can set them in the document using
188 % \cs{DTMsetstyle}, but without the \opt{useregional} setting on the
189 % style will be changed by \cs{date}\meta{language}.
190 %\end{abstract}
191 %
192 %\changes{2.0.0}{2019-11-07}{%
193 % Added a proper introduction.
194 %}
195 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
196 %\changes{2.1.0}{2019-11-22}{Fixed version string.}
197 %
198 % \noindent
199 % As of version 2.0.0, there is support for both Ekavian and Ijekavian
200 % pronunciation in both Latin and Cyrillic, regions (Serbia, Bosnia and
201 % Herzegovina, Montenegro), numeric format variants (Roman month ordinals,
202 % optional leading zeros).
203 % The package provides two regionless styles, "serbian" (Latin) and "serbianc"
204 % (Cyrillic), as well as regional styles (explained in \autoref{sub:regions}).
205 %
206 % Neither month nor day of week abbreviations are supported.
207 % These aren't often used within dates in Serbian.
208 %
209 % \changes{2.1.0}{2019-11-22}{Mentioned starred \cs{DTMdate}}
210 % Thanks to the author of \sty{datetime2}, Dr Nicola L. C. Talbot,
211 % \sty{datetime2-serbian} now (since \sty{datetime2} v1.5.5 and
212 % \sty{datetime2-serbian} v1.1.0) supports a peculiar aspect of Serbian date
213 % formatting: omission of year ordinal's trailing dot when the date is followed
214 % by a punctuation mark such as a comma.
215 % This is facilitated by the starred versions of \cs{DTMdate} and
216 % \cs{DTMDate} --- \cs{DTMdate*} and \cs{DTMDate*}.
217 % This is explained better in \autoref{sub:pecs}.
218 %
219 % \bigskip
220 %
221 % {\itshape
222 % \noindent
223 % The package is generated from (Jinja2) templates by a Python script before
224 % it's uploaded to CTAN, so don't try to send patches to files you find there.
225 % All development is done on Gitlab
226 % (\url{https://gitlab.com/andrejr/datetime2-serbian}).
227 %
228 % If you're developing other datetime2 localization modules (or
229 % localization modules in general), the way the package is generated might be
230 % of interest to you.
231 % I actually tried writing the package by hand, but it was way too tedious.
232 % Generating most of the package from templates seems like the best way to do
233 % it.
234 %\changes{2.1.0}{2019-11-22}{fixed \acsu{utf-8} shortcut.}
235 % Along the way, I also wrote a small utility for generating \acsu{ascii} --
236 % \acsu{licr} strings from \acsu{utf-8} strings, and it can be found here:
237 % \url{https://gitlab.com/andrejr/utf8_to_licr}.
238 % I might publish it to CTAN if there is interest.
239 %
240 % All of Serbian Cyrillic localization strings are also automatically generated
241 % from Serbian Latin strings using my
242 % \href{https://gitlab.com/andrejr/srtools}{srtools} Python package, available
243 % on \href{https://pypi.org/project/srtools/}{PyPI} and
244 % \href{https://aur.archlinux.org/packages/python-srtools/}{AUR}.
245 % }
246 %
247 % \tableofcontents
248 %
249 % \section{The Documentation}
250 %
251 %\changes{2.0.0}{2019-11-07}{%
252 % Added installation guide.
253 %}
254 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
255 %
256 % \subsection{Installation}
257 % Extract the language definition files first:
258 % \begin{enumerate}
259 % \item
260 % Run \hologo{LuaLaTeX} over the file \texttt{datetime2-serbian.ins}: \\
261 % "lualatex datetime2-serbian.ins"
262 % %
263 % \item Move all \texttt{*.ldf} files to %
264 % \nolinkurl{TEXMF/tex/latex/datetime2-contrib/datetime2-serbian/}
265 % \end{enumerate}
266 % Then, you can compile the documentation yourself by executing
267 %\begin{verbatim}
268 %lualatex datetime2-serbian.dtx
269 %makeindex -s ginddt2s.ist datetime2-serbian.idx
270 %makeindex -s gglodt2s.ist -o datetime2-serbian.gls datetime2-serbian.glo
271 %lualatex datetime2-serbian.dtx
272 %lualatex datetime2-serbian.dtx
273 %\end{verbatim}
274 % or just use the precompiled documentation shipped with the source files.
275 % In both cases, copy the files \texttt{datetime2-serbian.pdf} and
276 % \texttt{README.md} to
277 % \nolinkurl{TEXMF/doc/latex/datetime2-contrib/datetime2-serbian/}.
278 %
279 %
280 % \subsection{Setting up \sty{datetime2} with a language module}
281 %
282 % \subsubsection{Loading a language module}
283 % \emph{There are three different ways to load the required language module.
284 % See the \sty{datetime2} documentation for further detail.}
285 %
286 % \medskip
287 %
288 % \paragraph{Variant 1:}
289 % Request the desired language module explicitly by passing one of the
290 % region options to the \sty{datetime2} package, such as "serbian", "serbianc",
291 % "sr-Cyrl-ME", \ldots{} (the full list can be found in \autoref{sub:regions}).%
292 %
293 %\begin{verbatim}
294 %\documentclass{article}
295 %\usepackage[serbian]{datetime2}
296 %\begin{document}
297 %\today
298 %\end{document}
299 %\end{verbatim}
300 %
301 % \paragraph{Variant 2:}
302 % Load \sty{babel} and pass the "serbian" or "serbianc" option to the
303 % \cs{documentclass} command (or to \sty{babel} directly).
304 % If you now pass the \opt{useregional} option to \sty{datetime2}, the language
305 % module suitable to the one specified with \sty{babel} is loaded:
306 %\begin{verbatim}
307 %\documentclass[serbian]{article}
308 %\usepackage{babel}
309 %\usepackage[useregional]{datetime2}
310 %\begin{document}
311 %\today
312 %\end{document}
313 %\end{verbatim}
314 %
315 % \paragraph{Variant 3:}
316 % When using \sty{polyglossia}, you should request the desired language module
317 % by passing one of the previously mentioned options to the \sty{datetime2}
318 % package:
319 %\begin{verbatim}
320 %\documentclass{article}
321 %\usepackage{polyglossia}
322 %\setmainlanguage{serbian}
323 %\usepackage[serbian]{datetime2}
324 %\begin{document}
325 %\today
326 %\end{document}
327 %\end{verbatim}
328 %
329 %\changes{2.0.0}{2019-11-07}{%
330 % Added regions and documented their use.
331 %}
332 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
333 % \subsection{Regions and scripts}\label{sub:regions}
334 %
335 % Serbian language is a rare example of synchronic digraphia --- a situation
336 % where all literate members of a society use two interchangeable writing
337 % systems (Cyrillic and Latin).
338 % This is true in all regions Serbian is spoken in (Serbia, Bosnia and
339 % Herzegovina, Montenegro).
340 % This is why every region has a Cyrillic and Latin variant, as well as the
341 % regionless styles ("serbian" and "serbianc").
342 %
343 % The only other difference between the regions is the default value of
344 % \hyperref[sub:pronu]{\opt{pronunciation}}, which is Ekavian by default for
345 % "serbian", "serbianc", "sr-*-RS" and Ijekavian for the rest.
346 %
347 % The full list of regions (and regionless styles, on top) is as follows:
348 %\begin{multicols}{2}
349 %\begin{verbatim}
350 %serbian
351 %sr-Latn
352 %sr-Latn-RS
353 %sr-Latn-ME
354 %sr-Latn-BA
355 %serbianc
356 %sr-Cyrl
357 %sr-Cyrl-RS
358 %sr-Cyrl-ME
359 %sr-Cyrl-BA
360 %\end{verbatim}
361 %\end{multicols}
362 %
363 %
364 % \subsection{Settings (Serbian-related)}
365 %\changes{2.0.0}{2019-11-07}{%
366 % Added documentation for new settings.
367 %}
368 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
369 %
370 % These settings can be changed using \sty{\\DTMlangsetup}.
371 % Here's an example showing how to set both multiple--choice and boolean
372 % settings.
373 %\begin{verbatim}
374 %\DTMlangsetup[serbian]{pronunciation=ijekavian, monthi}
375 %\end{verbatim}
376 %
377 %
378 % \subsubsectionopt{pronunciation}\label{sub:pronu}
379 %\changes{2.0.0}{2019-11-07}{%
380 % Added a way to switch between Ekavian and Ijekavian pronunciation.
381 %}
382 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
383 % May take values "ekavian" and "ijekavian", which denote the two most
384 % frequently used pronunciations in Serbian language.
385 % The only difference is in the way weekdays are written.
386 %
387 % The default value is Ekavian by default for "serbian", "serbianc", "sr-*-RS"
388 % and Ijekavian for the rest of the regions.
389 %
390 % \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.}
391 % \bigskip
392 % \noindent
393 % ponedeljak, 4. novembar 2019. \hfill \emph{Ekavian pronunciation} \\
394 % ponedjeljak, 4. novembar 2019. \hfill \emph{Ijekavian pronunciation}
395 %
396 %
397 % \subsubsectionopt{monthi}
398 %\changes{2.0.0}{2019-11-07}{%
399 % Added a way to switch June, July alternate spellings.
400 %}
401 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
402 % This is a boolean key.
403 % If "false" (the default), the months June and July are spelled as \emph{Jun}
404 % and \emph{Jul}.
405 % If "true", the months June and July are spelled as \emph{Juni} and
406 % \emph{Juli}.
407 %
408 % \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.}
409 % \bigskip
410 % \noindent
411 % 15. juni 1389. \hfill "monthi=true" \\
412 % 15. jun 1389. \hfill "monthi=false"
413 %
414 % \subsubsectionopt{leadingzero}\label{sub:leadingzero}
415 %\changes{2.0.0}{2019-11-07}{%
416 % Added a switch for toggling leading zeroes in day and month ordinals.
417 %}
418 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
419 % This is a boolean key.
420 % If "false" (the default), there is no leading zero for hours, days or months.
421 % If "true", there is.
422 %
423 % \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.}
424 % \bigskip
425 % \noindent
426 % уторак, 2. 4. 2019. 8.03 CET \hfill "leadingzero=false" \\
427 % уторак, 02. 04. 2019. 08.03 CET \hfill "leadingzero=true"
428 %
429 % \subsubsectionopt{monthord}
430 %\changes{2.0.0}{2019-11-07}{%
431 % Added a switch between multiple numeric month ordinal formats used in
432 % Serbian.
433 %}
434 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
435 %\changes{2.0.1}{2019-11-11}{Changed colon \rightarrow{} period.}
436 % This key defines the way the month ordinal is written in Serbian "*-numeric"
437 % formats.
438 % This key defines the way the month ordinal is written in Serbian "*-numeric"
439 % It takes values "arabic" (the default), "roman" and "romanlsc".
440 % The "arabic" setting results in an arabic numeral (subject to
441 % \nameref{sub:leadingzero}) followed by a period.
442 %
443 % The "roman" setting results in an uppercase Roman numeral without a period
444 % suffix.
445 % The "romansc" setting results in a lowercase small caps Roman numeral without
446 % a period suffix (this looks better than regular uppercase when usign old
447 % style figures).
448 %
449 % \changes{2.0.1}{2019-11-11}{Fixed paragraph indentation.}
450 % \changes{2.0.1}{2019-11-11}{Fixed wrong example.}
451 % \bigskip
452 % \noindent
453 % уторак, 2. 4. 2019. 8.03 CET \hfill "monthord=arabic" \\
454 % \liningnums{уторак, 2. IV 2019. 8.03 CET} \hfill "monthord=roman" with
455 % \cs{liningnums} \\
456 % \oldstylenums{уторак, 2. \textsc{iv} 2019. 8.03 CET} \hfill
457 % "monthord=romanlsc" with \cs{oldstylenums}
458 %
459 % \subsection{Peculiarities of Serbian date formatting}\label{sub:pecs}
460 % \changes{2.1.0}{2019-11-22}{Mentioned starred \cs{DTMdate}}
461 % \marginpar{%
462 % All numbers in a date are considered to be ordinals in Serbian.
463 % Hence, the dots in Serbian dates aren't seen as mere separators, but
464 % ordinal designations.
465 % }
466 % Date rules in Serbian language feature a dot after the year (the ordinal dot)
467 % in \emph{almost} every case.
468 % When the date is followed by a punctuation mark, the trailing dot is omitted.
469 % When a sentence ends with a date, the date's trailing dot is also omitted, so
470 % the sentence ends in a single period (or question or exclamation mark).
471 %
472 % \smallskip
473 % \noindent
474 % Here are some examples:
475 %
476 % \begin{flushenumerate}
477 % \item Za 21. 2. 2019. i 3. 10. 2019. smo zakazali okupljanja.
478 % \item Prva verzija je izašla 17. 9. 1991, nakon nepune godine razvoja.
479 % \item Da li svima odgovara 21. februar 2019?
480 % \item Konferencija je održana 6. 8. 2013.
481 % \end{flushenumerate}
482 %
483 % To facilitate this, \sty{datetime2} and \sty{datetime2-serbian} provide
484 % starred alternatives for \cs{DTMdate} and \cs{DTMDate}, which omit the
485 % trailing dot.
486 % Such alternatives for \cs{DTMdisplaydate}, \cs{today}, etc.\ are not
487 % possible, since they would prevent said macros from working in expandable
488 % contexts (such as \acsu{pdf} bookmarks).
489 % It is the primary design feature of these commands to work in expandable
490 % contexts.
491 % Still, \cs{DTMdate*} and \cs{DTMDate} should cover most of our needs.
492 %
493 % Now, here's how we'd write example from above:
494 %\begin{verbatim}
495 % Za \DTMdate{2019-02-21} i \DTMdate{2019-10-03} smo zakazali okupljanja.
496 % Prva verzija je izašla \DTMdate*{1991-09-17}, nakon nepune godine razvoja.
497 % Da li svima odgovara \DTMdate*{2019-02-21}?
498 % Konferencija je održana \DTMdate*{2013-08-06}.
499 %\end{verbatim}
500 %
501 % \subsection{Other features and settings}
502 %
503 % \subsubsection{Showing the weekday}
504 %\changes{2.0.0}{2019-11-07}{%
505 % Added weekday names.
506 %}
507 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
508 % All language modules shipped with \sty{datetime2-serbian} support showing the
509 % weekday.
510 % To enable this feature, pass the \opt{showdow} option to the \sty{datetime2}
511 % package.
512 %
513 % \subsubsection{Generic customization of styles}
514 % There are a number of settings provided that can be used in \cs{DTMlangsetup}
515 % to modify the date-time style.
516 % These should be present in all "datetime2-*" packages and are present in
517 % all Serbian regionless and regional styles
518 %
519 % These are:
520 % \begin{optdescription}
521 % \itemopt{dowdaysep}%
522 % The separator between the day of week name and the day of month number.
523 %
524 % \itemopt{daymonthsep}%
525 % The separator between the day and the month name.
526 %
527 % \itemopt{monthyearsep}%
528 % The separator between the month name and year.
529 %
530 % \itemopt{datesep}%
531 % The separator between the date numbers in the numeric styles.
532 %
533 % \itemopt{timesep}%
534 % The separator between hours, minutes and seconds.
535 %
536 % \itemopt{datetimesep}%
537 % The separator between the date and time for the full date-time format.
538 %
539 % \itemopt{timezonesep}%
540 % The separator between the time and zone for the full date-time format.
541 %
542 % \itemopt{mapzone}%
543 % This is a boolean key. If true, the time zone mappings are applied.
544 %
545 % \itemopt{showdayofmonth}%
546 % A boolean key that determines whether or not to show the day of the month.
547 %
548 % \itemopt{showyear}%
549 % A boolean key that determines whether or not to show the year.
550 %\end{optdescription}
551 %
552 % Although the keys listed here are \emph{defined} for all variant styles, it
553 % depends on \sty{datetime2}'s setup and the requested styles whether they're
554 % \emph{used}. \\
555 % For more information about the \cs{DTMlangsetup} command see the documentation
556 % of the main \sty{datetime2} package.
557 %
558 %
559 % \subsection{License}
560 % This material is subject to the \LaTeX\ Project Public License, Version 1.3c or later. \\
561 % See the copyright headers of the single files for further details.
562 %
563 %\StopEventually{%
564 % \clearpage
565 % \section*{Acronyms}
566 % \addcontentsline{toc}{section}{Acronyms}%
567 % \begin{acronym}[asciim]
568 % \acro{ascii}{American Standard Code for Information
569 % Interchange\acroextra{, legacy 7-bit text encoding used on American
570 % computers since the 1960s.
571 % It fails to encode non-English characters.
572 % The mainstream encoding used when \hologo{TeX} was concieved.
573 % }}
574 % \acro{utf-8}{Unicode Transformation Format -- 8-bit\acroextra{,
575 % modern variable width character encoding that's backward-compatible with
576 % \acs*{ascii} for all \acs*{ascii} characters, yet provides full coverage
577 % for almost every spoken language.}}
578 % \acro{licr}{\LaTeX{} Internal Character Representation\acroextra{, a set
579 % of macros that help define non-\acs*{ascii} characters for typesetting in
580 % \LaTeX{} even in engines that only support \acs*{ascii}.}}
581 % \acro{pdf}{Portable Document Format}
582 % \end{acronym}
583 % \phantomsection
584 % \addcontentsline{toc}{section}{Change History}%
585 % \PrintChanges
586 % \addcontentsline{toc}{section}{\indexname}%
587 % \PrintIndex
588 %}
589 %
590 %\newgeometry{left=5cm,right=2.75cm,top=3.25cm,bottom=3cm}
591 %
592 %\section{The Code}
593 %
594 %\iffalse
595 % \begin{macrocode}
596 %<*datetime2-serbian-base.ldf>
597 % \end{macrocode}
598 %\fi
599 %\subsection{Base package localization strings}
600 %
601 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraphs.}
602 % This file contains the code common to all the Serbian regional
603 % variations.
604 % The localization strings are later imported with the appropriate encoding.
605 %
606 %\changes{1.0}{2015-03-31}{Initial release}
607 %\changes{2.0.0}{2019-11-07}{%
608 % Separated the base package from the regionless style.
609 % The base package now only declares common localization strings and includes
610 % adequately encoded localization strings from their respective packages.
611 %}
612 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
613 %
614 % \begin{macrocode}
615 \ProvidesDateTimeModule{serbian-base}[2019/11/22 v2.1.0]
616 % \end{macrocode}
617 %
618 %
619 %\begin{macro}{\DTMserbianordinalROMAN}
620 % Uppercase Roman numerals.
621 % \begin{macrocode}
622 \newcommand*{\DTMserbianordinalROMAN}[1]{%
623 \ifcase#1
624 \or%
625 I%
626 \or%
627 II%
628 \or%
629 III%
630 \or%
631 IV%
632 \or%
633 V%
634 \or%
635 VI%
636 \or%
637 VII%
638 \or%
639 VIII%
640 \or%
641 IX%
642 \or%
643 X%
644 \or%
645 XI%
646 \or%
647 XII%
648 \fi
649 }
650 % \end{macrocode}
651 %\end{macro}
652 %
653 %
654 %\begin{macro}{\DTMserbianordinalroman}
655 % Lowercase Roman numerals.
656 % \begin{macrocode}
657 \newcommand*{\DTMserbianordinalroman}[1]{%
658 \ifcase#1
659 \or%
660 i%
661 \or%
662 ii%
663 \or%
664 iii%
665 \or%
666 iv%
667 \or%
668 v%
669 \or%
670 vi%
671 \or%
672 vii%
673 \or%
674 viii%
675 \or%
676 ix%
677 \or%
678 x%
679 \or%
680 xi%
681 \or%
682 xii%
683 \fi
684 }
685 % \end{macrocode}
686 %\end{macro}
687 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
688 % We will now include the appropriate localization data.
689 %
690 % Packages \sty{ifxetex} and \sty{ifluatex} provide a way to determine if the
691 % currently used \LaTeX{} engine is \hologo{XeLaTeX} or \hologo{LuaLaTeX},
692 % respectively.
693 % \begin{macrocode}
694 \RequirePackage{ifxetex,ifluatex}
695 % \end{macrocode}
696 % Load \texttt{serbian-utf8} if either \hologo{XeLaTeX} or \hologo{LuaLaTeX}
697 % are used, since these engines natively support utf-8.
698 % Otherwise load \texttt{serbian-ascii}, which provides support for legacy
699 % engines that only support \ac{licr}.
700 % \begin{macrocode}
701 \ifxetex%
702 \RequireDateTimeModule{serbian-base-utf8}
703 \else
704 \ifluatex%
705 \RequireDateTimeModule{serbian-base-utf8}
706 \else
707 \RequireDateTimeModule{serbian-base-ascii}
708 \fi
709 \fi
710 % \end{macrocode}
711 %
712 %\iffalse
713 % \begin{macrocode}
714 %</datetime2-serbian-base.ldf>
715 % \end{macrocode}
716 %\fi
717 %
718 %
719 %
720 %\iffalse
721 % \begin{macrocode}
722 %<*datetime2-serbian-base-utf8.ldf>
723 % \end{macrocode}
724 %\fi
725 %\subsection{Base Serbian \acs{utf-8} localization strings}
726 % This file contains the localization strings necessary for proper date
727 % formatting in \acs{utf-8} format.
728 % This file is loaded if \hologo{XeLaTeX} or \hologo{LuaLaTeX} are used.
729 %
730 %\changes{1.0}{2015-03-31}{Initial release}
731 %\changes{2.0.0}{2019-11-07}{%
732 % All localization strings are now declared within the Python build script
733 % and both the \acs{utf-8} and \acs{licr} encoded strings are generated from
734 % said files on build, before uploading to CTAN.
735 %}
736 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
737 % \begin{macrocode}
738 \ProvidesDateTimeModule{serbian-base-utf8}[2019/11/22 v2.1.0]
739 % \end{macrocode}
740 %
741 %\subsubsection{Latin month names}
742 %
743 %\begin{macro}{\DTMserbianlatnoimonthname}
744 % Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
745 % non-capitalized.
746 % \begin{macrocode}
747 \newcommand*{\DTMserbianlatnoimonthname}[1]{%
748 \ifcase#1
749 \or%
750 januar%
751 \or%
752 februar%
753 \or%
754 mart%
755 \or%
756 april%
757 \or%
758 maj%
759 \or%
760 jun%
761 \or%
762 jul%
763 \or%
764 avgust%
765 \or%
766 septembar%
767 \or%
768 oktobar%
769 \or%
770 novembar%
771 \or%
772 decembar%
773 \fi
774 }
775 % \end{macrocode}
776 %\end{macro}
777 %
778 %\begin{macro}{\DTMserbianlatnoiMonthname}
779 % Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
780 % capitalized.
781 % \begin{macrocode}
782 \newcommand*{\DTMserbianlatnoiMonthname}[1]{%
783 \ifcase#1
784 \or%
785 Januar%
786 \or%
787 Februar%
788 \or%
789 Mart%
790 \or%
791 April%
792 \or%
793 Maj%
794 \or%
795 Jun%
796 \or%
797 Jul%
798 \or%
799 Avgust%
800 \or%
801 Septembar%
802 \or%
803 Oktobar%
804 \or%
805 Novembar%
806 \or%
807 Decembar%
808 \fi
809 }
810 % \end{macrocode}
811 %\end{macro}
812 %
813 %\begin{macro}{\DTMserbianlatimonthname}
814 % Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
815 % non-capitalized.
816 % \begin{macrocode}
817 \newcommand*{\DTMserbianlatimonthname}[1]{%
818 \ifnum#1=6%
819 juni%
820 \else\ifnum\#1=7%
821 juli%
822 \else
823 \DTMserbianlatnoimonthname%
824 \fi\fi
825 }
826 % \end{macrocode}
827 %\end{macro}
828 %
829 %\begin{macro}{\DTMserbianlatiMonthname}
830 % Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
831 % capitalized.
832 % \begin{macrocode}
833 \newcommand*{\DTMserbianlatiMonthname}[1]{%
834 \ifnum#1=6%
835 Juni%
836 \else\ifnum\#1=7%
837 Juli%
838 \else
839 \DTMserbianlatnoimonthname%
840 \fi\fi
841 }
842 % \end{macrocode}
843 %\end{macro}
844 %
845 %\subsubsection{Latin days of week, Ekavian pronunciation}
846 %
847 %\begin{macro}{\DTMserbianlatekweekdayname}
848 % Serbian weekday names, Latin alphabet, Ekavian pronunciation,
849 % non-capitalized
850 % \begin{macrocode}
851 \newcommand*{\DTMserbianlatekweekdayname}[1]{%
852 \ifcase#1
853 ponedeljak%
854 \or%
855 utorak%
856 \or%
857 sreda%
858 \or%
859 četvrtak%
860 \or%
861 petak%
862 \or%
863 subota%
864 \or%
865 nedelja%
866 \fi%
867 }
868 % \end{macrocode}
869 %\end{macro}
870 %
871 %\begin{macro}{\DTMserbianlatekWeekdayname}
872 % Serbian weekday names, Latin alphabet, Ekavian pronunciation, capitalized
873 % \begin{macrocode}
874 \newcommand*{\DTMserbianlatekWeekdayname}[1]{%
875 \ifcase#1
876 Ponedeljak%
877 \or%
878 Utorak%
879 \or%
880 Sreda%
881 \or%
882 Četvrtak%
883 \or%
884 Petak%
885 \or%
886 Subota%
887 \or%
888 Nedelja%
889 \fi%
890 }
891 % \end{macrocode}
892 %\end{macro}
893 %
894 %\subsubsection{Latin days of week, Ijekavian pronunciation}
895 %
896 %
897 %\begin{macro}{\DTMserbianlatijweekdayname}
898 % Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
899 % non-capitalized
900 % \begin{macrocode}
901 \newcommand*{\DTMserbianlatijweekdayname}[1]{%
902 \ifcase#1
903 ponedjeljak%
904 \or%
905 utorak%
906 \or%
907 srijeda%
908 \or%
909 četvrtak%
910 \or%
911 petak%
912 \or%
913 subota%
914 \or%
915 nedjelja%
916 \fi%
917 }
918 % \end{macrocode}
919 %\end{macro}
920 %
921 %\begin{macro}{\DTMserbianlatijWeekdayname}
922 % Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
923 % capitalized
924 % \begin{macrocode}
925 \newcommand*{\DTMserbianlatijWeekdayname}[1]{%
926 \ifcase#1
927 Ponedjeljak%
928 \or%
929 Utorak%
930 \or%
931 Srijeda%
932 \or%
933 Četvrtak%
934 \or%
935 Petak%
936 \or%
937 Subota%
938 \or%
939 Nedjelja%
940 \fi%
941 }
942 % \end{macrocode}
943 %\end{macro}
944 %
945 %
946 %\subsubsection{Cyrillic month names}
947 %
948 %\begin{macro}{\DTMserbiancyrnoimonthname}
949 % Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
950 % non-capitalized.
951 % \begin{macrocode}
952 \newcommand*{\DTMserbiancyrnoimonthname}[1]{%
953 \ifcase#1
954 \or%
955 јануар%
956 \or%
957 фебруар%
958 \or%
959 март%
960 \or%
961 април%
962 \or%
963 мај%
964 \or%
965 јун%
966 \or%
967 јул%
968 \or%
969 август%
970 \or%
971 септембар%
972 \or%
973 октобар%
974 \or%
975 новембар%
976 \or%
977 децембар%
978 \fi
979 }
980 % \end{macrocode}
981 %\end{macro}
982 %
983 %\begin{macro}{\DTMserbiancyrnoiMonthname}
984 % Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
985 % capitalized.
986 % \begin{macrocode}
987 \newcommand*{\DTMserbiancyrnoiMonthname}[1]{%
988 \ifcase#1
989 \or%
990 Јануар%
991 \or%
992 Фебруар%
993 \or%
994 Март%
995 \or%
996 Април%
997 \or%
998 Мај%
999 \or%
1000 Јун%
1001 \or%
1002 Јул%
1003 \or%
1004 Август%
1005 \or%
1006 Септембар%
1007 \or%
1008 Октобар%
1009 \or%
1010 Новембар%
1011 \or%
1012 Децембар%
1013 \fi
1014 }
1015 % \end{macrocode}
1016 %\end{macro}
1017 %
1018 %\begin{macro}{\DTMserbiancyrimonthname}
1019 % Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
1020 % non-capitalized.
1021 % \begin{macrocode}
1022 \newcommand*{\DTMserbiancyrimonthname}[1]{%
1023 \ifnum#1=6%
1024 јуни%
1025 \else\ifnum\#1=7%
1026 јули%
1027 \else
1028 \DTMserbiancyrnoimonthname%
1029 \fi\fi
1030 }
1031 % \end{macrocode}
1032 %\end{macro}
1033 %
1034 %\begin{macro}{\DTMserbiancyriMonthname}
1035 % Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
1036 % capitalized.
1037 % \begin{macrocode}
1038 \newcommand*{\DTMserbiancyriMonthname}[1]{%
1039 \ifnum#1=6%
1040 Јуни%
1041 \else\ifnum\#1=7%
1042 Јули%
1043 \else
1044 \DTMserbiancyrnoimonthname%
1045 \fi\fi
1046 }
1047 % \end{macrocode}
1048 %\end{macro}
1049 %
1050 %\subsubsection{Cyrillic days of week, Ekavian pronunciation}
1051 %
1052 %\begin{macro}{\DTMserbiancyrekweekdayname}
1053 % Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation,
1054 % non-capitalized
1055 % \begin{macrocode}
1056 \newcommand*{\DTMserbiancyrekweekdayname}[1]{%
1057 \ifcase#1
1058 понедељак%
1059 \or%
1060 уторак%
1061 \or%
1062 среда%
1063 \or%
1064 четвртак%
1065 \or%
1066 петак%
1067 \or%
1068 субота%
1069 \or%
1070 недеља%
1071 \fi%
1072 }
1073 % \end{macrocode}
1074 %\end{macro}
1075 %
1076 %\begin{macro}{\DTMserbiancyrekWeekdayname}
1077 % Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation, capitalized
1078 % \begin{macrocode}
1079 \newcommand*{\DTMserbiancyrekWeekdayname}[1]{%
1080 \ifcase#1
1081 Понедељак%
1082 \or%
1083 Уторак%
1084 \or%
1085 Среда%
1086 \or%
1087 Четвртак%
1088 \or%
1089 Петак%
1090 \or%
1091 Субота%
1092 \or%
1093 Недеља%
1094 \fi%
1095 }
1096 % \end{macrocode}
1097 %\end{macro}
1098 %
1099 %\subsubsection{Cyrillic days of week, Ijekavian pronunciation}
1100 %
1101 %
1102 %\begin{macro}{\DTMserbiancyrijweekdayname}
1103 % Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
1104 % non-capitalized
1105 % \begin{macrocode}
1106 \newcommand*{\DTMserbiancyrijweekdayname}[1]{%
1107 \ifcase#1
1108 понедјељак%
1109 \or%
1110 уторак%
1111 \or%
1112 сриједа%
1113 \or%
1114 четвртак%
1115 \or%
1116 петак%
1117 \or%
1118 субота%
1119 \or%
1120 недјеља%
1121 \fi%
1122 }
1123 % \end{macrocode}
1124 %\end{macro}
1125 %
1126 %\begin{macro}{\DTMserbiancyrijWeekdayname}
1127 % Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
1128 % capitalized
1129 % \begin{macrocode}
1130 \newcommand*{\DTMserbiancyrijWeekdayname}[1]{%
1131 \ifcase#1
1132 Понедјељак%
1133 \or%
1134 Уторак%
1135 \or%
1136 Сриједа%
1137 \or%
1138 Четвртак%
1139 \or%
1140 Петак%
1141 \or%
1142 Субота%
1143 \or%
1144 Недјеља%
1145 \fi%
1146 }
1147 % \end{macrocode}
1148 %\end{macro}
1149 %
1150 %
1151 %
1152 %\iffalse
1153 % \begin{macrocode}
1154 %</datetime2-serbian-base-utf8.ldf>
1155 % \end{macrocode}
1156 %\fi
1157 %
1158 %\iffalse
1159 % \begin{macrocode}
1160 %<*datetime2-serbian-base-ascii.ldf>
1161 % \end{macrocode}
1162 %\fi
1163 %\subsection{Base Serbian \acs{ascii} --- \acs{licr} localization strings}
1164 % This file contains the localization strings necessary for proper date
1165 % formatting in \ac{licr} format, which is \acs{ascii}-compatible.
1166 % It provides support for legacy \LaTeX{} engines that only support this kind
1167 % of format and encoding.
1168 %
1169 % This part of the file is generated from the \acs{utf-8} version with the
1170 % help of a tool I wrote, since writing pure \ac{licr} by hand would be
1171 % quite insane.
1172 %
1173 %\changes{1.0}{2015-03-31}{Initial release}
1174 %\changes{2.0.0}{2019-11-07}{%
1175 % All localization strings are now declared within the Python build script
1176 % and both the \acs{utf-8} and \acs{licr} encoded strings are generated from
1177 % said files on build, before uploading to CTAN.
1178 %}
1179 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1180 %
1181 % \begin{macrocode}
1182 \ProvidesDateTimeModule{serbian-base-ascii}[2019/11/22 v2.1.0]
1183 % \end{macrocode}
1184 %
1185 %%\subsubsection{Latin month names}
1186 %
1187 %\begin{macro}{\DTMserbianlatnoimonthname}
1188 % Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
1189 % non-capitalized.
1190 % \begin{macrocode}
1191 \newcommand*{\DTMserbianlatnoimonthname}[1]{%
1192 \ifcase#1
1193 \or%
1194 januar%
1195 \or%
1196 februar%
1197 \or%
1198 mart%
1199 \or%
1200 april%
1201 \or%
1202 maj%
1203 \or%
1204 jun%
1205 \or%
1206 jul%
1207 \or%
1208 avgust%
1209 \or%
1210 septembar%
1211 \or%
1212 oktobar%
1213 \or%
1214 novembar%
1215 \or%
1216 decembar%
1217 \fi
1218 }
1219 % \end{macrocode}
1220 %\end{macro}
1221 %
1222 %\begin{macro}{\DTMserbianlatnoiMonthname}
1223 % Serbian month names, Latin alphabet, no \sty{i} suffix for June and July,
1224 % capitalized.
1225 % \begin{macrocode}
1226 \newcommand*{\DTMserbianlatnoiMonthname}[1]{%
1227 \ifcase#1
1228 \or%
1229 Januar%
1230 \or%
1231 Februar%
1232 \or%
1233 Mart%
1234 \or%
1235 April%
1236 \or%
1237 Maj%
1238 \or%
1239 Jun%
1240 \or%
1241 Jul%
1242 \or%
1243 Avgust%
1244 \or%
1245 Septembar%
1246 \or%
1247 Oktobar%
1248 \or%
1249 Novembar%
1250 \or%
1251 Decembar%
1252 \fi
1253 }
1254 % \end{macrocode}
1255 %\end{macro}
1256 %
1257 %\begin{macro}{\DTMserbianlatimonthname}
1258 % Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
1259 % non-capitalized.
1260 % \begin{macrocode}
1261 \newcommand*{\DTMserbianlatimonthname}[1]{%
1262 \ifnum#1=6%
1263 juni%
1264 \else\ifnum\#1=7%
1265 juli%
1266 \else
1267 \DTMserbianlatnoimonthname%
1268 \fi\fi
1269 }
1270 % \end{macrocode}
1271 %\end{macro}
1272 %
1273 %\begin{macro}{\DTMserbianlatiMonthname}
1274 % Serbian month names, Latin alphabet, \sty{i} suffix for June and July,
1275 % capitalized.
1276 % \begin{macrocode}
1277 \newcommand*{\DTMserbianlatiMonthname}[1]{%
1278 \ifnum#1=6%
1279 Juni%
1280 \else\ifnum\#1=7%
1281 Juli%
1282 \else
1283 \DTMserbianlatnoimonthname%
1284 \fi\fi
1285 }
1286 % \end{macrocode}
1287 %\end{macro}
1288 %
1289 %\subsubsection{Latin days of week, Ekavian pronunciation}
1290 %
1291 %\begin{macro}{\DTMserbianlatekweekdayname}
1292 % Serbian weekday names, Latin alphabet, Ekavian pronunciation,
1293 % non-capitalized
1294 % \begin{macrocode}
1295 \newcommand*{\DTMserbianlatekweekdayname}[1]{%
1296 \ifcase#1
1297 ponedeljak%
1298 \or%
1299 utorak%
1300 \or%
1301 sreda%
1302 \or%
1303 \v cetvrtak%
1304 \or%
1305 petak%
1306 \or%
1307 subota%
1308 \or%
1309 nedelja%
1310 \fi%
1311 }
1312 % \end{macrocode}
1313 %\end{macro}
1314 %
1315 %\begin{macro}{\DTMserbianlatekWeekdayname}
1316 % Serbian weekday names, Latin alphabet, Ekavian pronunciation, capitalized
1317 % \begin{macrocode}
1318 \newcommand*{\DTMserbianlatekWeekdayname}[1]{%
1319 \ifcase#1
1320 Ponedeljak%
1321 \or%
1322 Utorak%
1323 \or%
1324 Sreda%
1325 \or%
1326 \v Cetvrtak%
1327 \or%
1328 Petak%
1329 \or%
1330 Subota%
1331 \or%
1332 Nedelja%
1333 \fi%
1334 }
1335 % \end{macrocode}
1336 %\end{macro}
1337 %
1338 %\subsubsection{Latin days of week, Ijekavian pronunciation}
1339 %
1340 %
1341 %\begin{macro}{\DTMserbianlatijweekdayname}
1342 % Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
1343 % non-capitalized
1344 % \begin{macrocode}
1345 \newcommand*{\DTMserbianlatijweekdayname}[1]{%
1346 \ifcase#1
1347 ponedjeljak%
1348 \or%
1349 utorak%
1350 \or%
1351 srijeda%
1352 \or%
1353 \v cetvrtak%
1354 \or%
1355 petak%
1356 \or%
1357 subota%
1358 \or%
1359 nedjelja%
1360 \fi%
1361 }
1362 % \end{macrocode}
1363 %\end{macro}
1364 %
1365 %\begin{macro}{\DTMserbianlatijWeekdayname}
1366 % Serbian weekday names, Latin alphabet, Ijekavian pronunciation,
1367 % capitalized
1368 % \begin{macrocode}
1369 \newcommand*{\DTMserbianlatijWeekdayname}[1]{%
1370 \ifcase#1
1371 Ponedjeljak%
1372 \or%
1373 Utorak%
1374 \or%
1375 Srijeda%
1376 \or%
1377 \v Cetvrtak%
1378 \or%
1379 Petak%
1380 \or%
1381 Subota%
1382 \or%
1383 Nedjelja%
1384 \fi%
1385 }
1386 % \end{macrocode}
1387 %\end{macro}
1388 %
1389 %
1390 %\subsubsection{Cyrillic month names}
1391 %
1392 %\begin{macro}{\DTMserbiancyrnoimonthname}
1393 % Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
1394 % non-capitalized.
1395 % \begin{macrocode}
1396 \newcommand*{\DTMserbiancyrnoimonthname}[1]{%
1397 \ifcase#1
1398 \or%
1399 \cyrje\cyra\cyrn\cyru\cyra\cyrr%
1400 \or%
1401 \cyrf\cyre\cyrb\cyrr\cyru\cyra\cyrr%
1402 \or%
1403 \cyrm\cyra\cyrr\cyrt%
1404 \or%
1405 \cyra\cyrp\cyrr\cyri\cyrl%
1406 \or%
1407 \cyrm\cyra\cyrje%
1408 \or%
1409 \cyrje\cyru\cyrn%
1410 \or%
1411 \cyrje\cyru\cyrl%
1412 \or%
1413 \cyra\cyrv\cyrg\cyru\cyrs\cyrt%
1414 \or%
1415 \cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrb\cyra\cyrr%
1416 \or%
1417 \cyro\cyrk\cyrt\cyro\cyrb\cyra\cyrr%
1418 \or%
1419 \cyrn\cyro\cyrv\cyre\cyrm\cyrb\cyra\cyrr%
1420 \or%
1421 \cyrd\cyre\cyrc\cyre\cyrm\cyrb\cyra\cyrr%
1422 \fi
1423 }
1424 % \end{macrocode}
1425 %\end{macro}
1426 %
1427 %\begin{macro}{\DTMserbiancyrnoiMonthname}
1428 % Serbian month names, Cyrillic alphabet, no \sty{i} suffix for June and July,
1429 % capitalized.
1430 % \begin{macrocode}
1431 \newcommand*{\DTMserbiancyrnoiMonthname}[1]{%
1432 \ifcase#1
1433 \or%
1434 \CYRJE\cyra\cyrn\cyru\cyra\cyrr%
1435 \or%
1436 \CYRF\cyre\cyrb\cyrr\cyru\cyra\cyrr%
1437 \or%
1438 \CYRM\cyra\cyrr\cyrt%
1439 \or%
1440 \CYRA\cyrp\cyrr\cyri\cyrl%
1441 \or%
1442 \CYRM\cyra\cyrje%
1443 \or%
1444 \CYRJE\cyru\cyrn%
1445 \or%
1446 \CYRJE\cyru\cyrl%
1447 \or%
1448 \CYRA\cyrv\cyrg\cyru\cyrs\cyrt%
1449 \or%
1450 \CYRS\cyre\cyrp\cyrt\cyre\cyrm\cyrb\cyra\cyrr%
1451 \or%
1452 \CYRO\cyrk\cyrt\cyro\cyrb\cyra\cyrr%
1453 \or%
1454 \CYRN\cyro\cyrv\cyre\cyrm\cyrb\cyra\cyrr%
1455 \or%
1456 \CYRD\cyre\cyrc\cyre\cyrm\cyrb\cyra\cyrr%
1457 \fi
1458 }
1459 % \end{macrocode}
1460 %\end{macro}
1461 %
1462 %\begin{macro}{\DTMserbiancyrimonthname}
1463 % Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
1464 % non-capitalized.
1465 % \begin{macrocode}
1466 \newcommand*{\DTMserbiancyrimonthname}[1]{%
1467 \ifnum#1=6%
1468 \cyrje\cyru\cyrn\cyri%
1469 \else\ifnum\#1=7%
1470 \cyrje\cyru\cyrl\cyri%
1471 \else
1472 \DTMserbiancyrnoimonthname%
1473 \fi\fi
1474 }
1475 % \end{macrocode}
1476 %\end{macro}
1477 %
1478 %\begin{macro}{\DTMserbiancyriMonthname}
1479 % Serbian month names, Cyrillic alphabet, \sty{i} suffix for June and July,
1480 % capitalized.
1481 % \begin{macrocode}
1482 \newcommand*{\DTMserbiancyriMonthname}[1]{%
1483 \ifnum#1=6%
1484 \CYRJE\cyru\cyrn\cyri%
1485 \else\ifnum\#1=7%
1486 \CYRJE\cyru\cyrl\cyri%
1487 \else
1488 \DTMserbiancyrnoimonthname%
1489 \fi\fi
1490 }
1491 % \end{macrocode}
1492 %\end{macro}
1493 %
1494 %\subsubsection{Cyrillic days of week, Ekavian pronunciation}
1495 %
1496 %\begin{macro}{\DTMserbiancyrekweekdayname}
1497 % Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation,
1498 % non-capitalized
1499 % \begin{macrocode}
1500 \newcommand*{\DTMserbiancyrekweekdayname}[1]{%
1501 \ifcase#1
1502 \cyrp\cyro\cyrn\cyre\cyrd\cyre\cyrlje\cyra\cyrk%
1503 \or%
1504 \cyru\cyrt\cyro\cyrr\cyra\cyrk%
1505 \or%
1506 \cyrs\cyrr\cyre\cyrd\cyra%
1507 \or%
1508 \cyrch\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
1509 \or%
1510 \cyrp\cyre\cyrt\cyra\cyrk%
1511 \or%
1512 \cyrs\cyru\cyrb\cyro\cyrt\cyra%
1513 \or%
1514 \cyrn\cyre\cyrd\cyre\cyrlje\cyra%
1515 \fi%
1516 }
1517 % \end{macrocode}
1518 %\end{macro}
1519 %
1520 %\begin{macro}{\DTMserbiancyrekWeekdayname}
1521 % Serbian weekday names, Cyrillic alphabet, Ekavian pronunciation, capitalized
1522 % \begin{macrocode}
1523 \newcommand*{\DTMserbiancyrekWeekdayname}[1]{%
1524 \ifcase#1
1525 \CYRP\cyro\cyrn\cyre\cyrd\cyre\cyrlje\cyra\cyrk%
1526 \or%
1527 \CYRU\cyrt\cyro\cyrr\cyra\cyrk%
1528 \or%
1529 \CYRS\cyrr\cyre\cyrd\cyra%
1530 \or%
1531 \CYRCH\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
1532 \or%
1533 \CYRP\cyre\cyrt\cyra\cyrk%
1534 \or%
1535 \CYRS\cyru\cyrb\cyro\cyrt\cyra%
1536 \or%
1537 \CYRN\cyre\cyrd\cyre\cyrlje\cyra%
1538 \fi%
1539 }
1540 % \end{macrocode}
1541 %\end{macro}
1542 %
1543 %\subsubsection{Cyrillic days of week, Ijekavian pronunciation}
1544 %
1545 %
1546 %\begin{macro}{\DTMserbiancyrijweekdayname}
1547 % Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
1548 % non-capitalized
1549 % \begin{macrocode}
1550 \newcommand*{\DTMserbiancyrijweekdayname}[1]{%
1551 \ifcase#1
1552 \cyrp\cyro\cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra\cyrk%
1553 \or%
1554 \cyru\cyrt\cyro\cyrr\cyra\cyrk%
1555 \or%
1556 \cyrs\cyrr\cyri\cyrje\cyre\cyrd\cyra%
1557 \or%
1558 \cyrch\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
1559 \or%
1560 \cyrp\cyre\cyrt\cyra\cyrk%
1561 \or%
1562 \cyrs\cyru\cyrb\cyro\cyrt\cyra%
1563 \or%
1564 \cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra%
1565 \fi%
1566 }
1567 % \end{macrocode}
1568 %\end{macro}
1569 %
1570 %\begin{macro}{\DTMserbiancyrijWeekdayname}
1571 % Serbian weekday names, Cyrillic alphabet, Ijekavian pronunciation,
1572 % capitalized
1573 % \begin{macrocode}
1574 \newcommand*{\DTMserbiancyrijWeekdayname}[1]{%
1575 \ifcase#1
1576 \CYRP\cyro\cyrn\cyre\cyrd\cyrje\cyre\cyrlje\cyra\cyrk%
1577 \or%
1578 \CYRU\cyrt\cyro\cyrr\cyra\cyrk%
1579 \or%
1580 \CYRS\cyrr\cyri\cyrje\cyre\cyrd\cyra%
1581 \or%
1582 \CYRCH\cyre\cyrt\cyrv\cyrr\cyrt\cyra\cyrk%
1583 \or%
1584 \CYRP\cyre\cyrt\cyra\cyrk%
1585 \or%
1586 \CYRS\cyru\cyrb\cyro\cyrt\cyra%
1587 \or%
1588 \CYRN\cyre\cyrd\cyrje\cyre\cyrlje\cyra%
1589 \fi%
1590 }
1591 % \end{macrocode}
1592 %\end{macro}
1593 %
1594 %
1595 %
1596 %\iffalse
1597 % \begin{macrocode}
1598 %</datetime2-serbian-base-ascii.ldf>
1599 % \end{macrocode}
1600 %\fi
1601 %
1602 %
1603 %\iffalse
1604 % \begin{macrocode}
1605 %<*datetime2-serbian.ldf>
1606 % \end{macrocode}
1607 %\fi
1608 %
1609 %\subsection{Serbian \sty{serbian} Code
1610 % (\texttt{datetime2-serbian.ldf})}
1611 %\changes{1.0}{2015-03-24}{Initial release}
1612 %\changes{2.0.0}{2019-11-07}{%
1613 % Added regions, all settings made available to regions so all changes can be
1614 % region-specific.
1615 %}
1616 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1617 % \begin{macrocode}
1618 \ProvidesDateTimeModule{serbian}[2019/11/22 v2.1.0]
1619 % \end{macrocode}
1620 %\changes{2.0.0}{2019-11-07}{%
1621 % All localization strings loaded from base module.
1622 %}
1623 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1624 % Load base Serbian module.
1625 % \begin{macrocode}
1626 \RequireDateTimeModule{serbian-base}
1627 % \end{macrocode}
1628 %
1629 %
1630 %
1631 %\subsubsection{Defining the \sty{serbian} style}
1632 %
1633 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1634 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
1635 % Allow the user a way of configuring the "serbian" and
1636 % "serbian-numeric" styles by providing macros for various format
1637 % elements.
1638 %
1639 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
1640 % case other date formats are also required.
1641 %
1642 %\begin{macro}{\DTMserbiandowdaysep}
1643 % The separator between weekday and day.
1644 % \begin{macrocode}
1645 \newcommand*{\DTMserbiandowdaysep}{,\space}
1646 % \end{macrocode}
1647 %\end{macro}
1648 %
1649 %
1650 %\begin{macro}{\DTMserbiandaymonthsep}
1651 % The separator between the day and month for the text format.
1652 % \begin{macrocode}
1653 \newcommand*{\DTMserbiandaymonthsep}{%
1654 \DTMtexorpdfstring{\protect~}{\space}%
1655 }
1656 % \end{macrocode}
1657 %\end{macro}
1658 %
1659 %\begin{macro}{\DTMserbianmonthyearsep}
1660 % The separator between the month and year for the text format.
1661 % \begin{macrocode}
1662 \newcommand*{\DTMserbianmonthyearsep}{\space}
1663 % \end{macrocode}
1664 %\end{macro}
1665 %
1666 %\begin{macro}{\DTMserbiandatetimesep}
1667 % The separator between the date and time blocks in the full format (either
1668 % text or numeric).
1669 % \begin{macrocode}
1670 \newcommand*{\DTMserbiandatetimesep}{\space}
1671 % \end{macrocode}
1672 %\end{macro}
1673 %
1674 %\begin{macro}{\DTMserbiantimezonesep}
1675 % The separator between the time and zone blocks in the full format (either
1676 % text or numeric).
1677 % \begin{macrocode}
1678 \newcommand*{\DTMserbiantimezonesep}{\space}
1679 % \end{macrocode}
1680 %\end{macro}
1681 %
1682 %\begin{macro}{\DTMserbiandatesep}
1683 % The separator for the numeric date format.
1684 % \begin{macrocode}
1685 \newcommand*{\DTMserbiandatesep}{.}
1686 % \end{macrocode}
1687 %\end{macro}
1688 %
1689 %\begin{macro}{\DTMserbiantimesep}
1690 % The separator for the numeric time format.
1691 % \begin{macrocode}
1692 \newcommand*{\DTMserbiantimesep}{.}
1693 % \end{macrocode}
1694 %\end{macro}
1695 %
1696 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
1697 % \begin{macrocode}
1698 \DTMdefkey{serbian}{dowdaysep}%
1699 {\renewcommand*{\DTMserbiandowdaysep}{#1}}
1700 \DTMdefkey{serbian}{daymonthsep}%
1701 {\renewcommand*{\DTMserbiandaymonthsep}{#1}}
1702 \DTMdefkey{serbian}{monthyearsep}%
1703 {\renewcommand*{\DTMserbianmonthyearsep}{#1}}
1704 \DTMdefkey{serbian}{datetimesep}%
1705 {\renewcommand*{\DTMserbiandatetimesep}{#1}}
1706 \DTMdefkey{serbian}{timezonesep}%
1707 {\renewcommand*{\DTMserbiantimezonesep}{#1}}
1708 \DTMdefkey{serbian}{datesep}%
1709 {\renewcommand*{\DTMserbiandatesep}{#1}}
1710 \DTMdefkey{serbian}{timesep}%
1711 {\renewcommand*{\DTMserbiantimesep}{#1}}
1712 % \end{macrocode}
1713 %
1714 %\subsubsection{Switches and settings}
1715 %
1716 %\changes{2.0.0}{2019-11-07}{%
1717 % Added weekday names.
1718 %}
1719 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1720 %\begin{macro}{\DTMserbianweekdayname}
1721 % Define the weekday name, lowercase.
1722 % \begin{macrocode}
1723 \newcommand*{\DTMserbianweekdayname}%
1724 {\DTMserbianlatekweekdayname}
1725 % \end{macrocode}
1726 %\end{macro}
1727
1728 %\begin{macro}{\DTMserbianweekdayname}
1729 % Define the weekday name, capitalized.
1730 % \begin{macrocode}
1731 \newcommand*{\DTMserbianWeekdayname}%
1732 {\DTMserbianlatekWeekdayname}
1733 % \end{macrocode}
1734 %\end{macro}
1735 %
1736 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
1737 %\changes{2.0.0}{2019-11-07}{%
1738 % Added a way to switch between Ekavian and Ijekavian pronunciation.
1739 %}
1740 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1741 %
1742 % \begin{macrocode}
1743 \DTMdefchoicekey{serbian}%
1744 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
1745 \ifcase\@dtm@nr\relax
1746 \renewcommand*{\DTMserbianweekdayname}%
1747 {\DTMserbianlatekweekdayname}%
1748 \renewcommand*{\DTMserbianWeekdayname}%
1749 {\DTMserbianlatekWeekdayname}%
1750 \or%
1751 \renewcommand*{\DTMserbianweekdayname}%
1752 {\DTMserbianlatijweekdayname}%
1753 \renewcommand*{\DTMserbianWeekdayname}
1754 {\DTMserbianlatijWeekdayname}%
1755 \fi
1756 }
1757 % \end{macrocode}
1758 %\changes{2.0.0}{2019-11-07}{%
1759 % Added a way to switch June, July alternate spellings.
1760 %}
1761 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1762 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1763 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
1764 % month spellings.
1765 % \begin{macrocode}
1766 \DTMdefboolkey{serbian}{monthi}[true]{}
1767 % \end{macrocode}
1768 % The default is without the "i" suffix.
1769 % \begin{macrocode}
1770 \DTMsetbool{serbian}{monthi}{false}
1771 % \end{macrocode}
1772 %\changes{2.0.0}{2019-11-07}{%
1773 % Added a switch for adding leading zeroes in day and month ordinals.
1774 %}
1775 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1776 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1777 % Define a boolean key that determines if the day and month ordinals should
1778 % have leading zeroes.
1779 % \begin{macrocode}
1780 \DTMdefboolkey{serbian}{leadingzero}[true]{}
1781 % \end{macrocode}
1782 % The default is to omit the leading zero.
1783 % \begin{macrocode}
1784 \DTMsetbool{serbian}{leadingzero}{false}
1785 % \end{macrocode}
1786 %
1787 %\begin{macro}{\DTMserbiandayordinal}
1788 % Define the day ordinal format to be used by this style.
1789 % \begin{macrocode}
1790 \newcommand*{\DTMserbiandayordinal}[1]{%
1791 \DTMifbool{serbian}{leadingzero}%
1792 {\DTMtwodigits{#1}}%
1793 {\number#1}\DTMserbiandatesep}%
1794 % \end{macrocode}
1795 %\end{macro}
1796 %
1797 %\changes{2.1.0}{2019-11-22}{%
1798 % Removed year ordinal macro since year ordinals are handled differently now.
1799 %}
1800 %\changes{2.0.0}{2019-11-07}{%
1801 % Removed the option to switch between writing systems, since that is
1802 % accomplished by using different regions or regionless styles ("serbian" and
1803 % "serbianc" for example).
1804 %}
1805 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1806 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1807 % Define the month names.
1808 %
1809 %\begin{macro}{\DTMserbiannoimonthname}
1810 % \begin{macrocode}
1811 \newcommand*{\DTMserbiannoimonthname}{\DTMserbianlatnoimonthname}
1812 % \end{macrocode}
1813 %\end{macro}
1814 %
1815 %\begin{macro}{\DTMserbiannoiMonthname}
1816 % \begin{macrocode}
1817 \newcommand*{\DTMserbiannoiMonthname}{\DTMserbianlatnoiMonthname}
1818 % \end{macrocode}
1819 %\end{macro}
1820 %
1821 %\begin{macro}{\DTMserbianimonthname}
1822 % \begin{macrocode}
1823 \newcommand*{\DTMserbianimonthname}{\DTMserbianlatimonthname}
1824 % \end{macrocode}
1825 %\end{macro}
1826 %
1827 %\begin{macro}{\DTMserbianiMonthname}
1828 % \begin{macrocode}
1829 \newcommand*{\DTMserbianiMonthname}{\DTMserbianlatiMonthname}
1830 % \end{macrocode}
1831 %\end{macro}
1832 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1833 % Define a boolean key that determines if the time zone mappings
1834 % should be used.
1835 % \begin{macrocode}
1836 \DTMdefboolkey{serbian}{mapzone}[true]{}
1837 % \end{macrocode}
1838 % The default is to use mappings.
1839 % \begin{macrocode}
1840 \DTMsetbool{serbian}{mapzone}{true}
1841 % \end{macrocode}
1842 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1843 % Define a boolean key that determines if the day of month should be
1844 % displayed.
1845 % \begin{macrocode}
1846 \DTMdefboolkey{serbian}{showdayofmonth}[true]{}
1847 % \end{macrocode}
1848 % The default is to show the day of month.
1849 % \begin{macrocode}
1850 \DTMsetbool{serbian}{showdayofmonth}{true}
1851 % \end{macrocode}
1852 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1853 % Define a boolean key that determines if the year should be
1854 % displayed.
1855 % \begin{macrocode}
1856 \DTMdefboolkey{serbian}{showyear}[true]{}
1857 % \end{macrocode}
1858 % The default is to show the year.
1859 % \begin{macrocode}
1860 \DTMsetbool{serbian}{showyear}{true}
1861 % \end{macrocode}
1862 %\changes{2.0.0}{2019-11-07}{%
1863 % Added weekday names.
1864 %}
1865 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1866 % \begin{macrocode}
1867 \DTMnewstyle%
1868 {serbian}% label
1869 {% date style
1870 \renewcommand*\DTMdisplaydate[4]{%
1871 \ifDTMshowdow%
1872 \ifnum##4>-1
1873 \DTMserbianweekdayname{##4}%
1874 \DTMserbiandowdaysep%
1875 \fi
1876 \fi
1877 \DTMifbool{serbian}{showdayofmonth}
1878 {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
1879 {}%
1880 \DTMifbool{serbian}{monthi}%
1881 {\DTMserbianimonthname{##2}}%
1882 {\DTMserbiannoimonthname{##2}}%
1883 \DTMifbool{serbian}{showyear}%
1884 {%
1885 \DTMserbianmonthyearsep%
1886 % \end{macrocode}
1887 %\changes{2.1.0}{2019-11-22}{%
1888 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
1889 % and \cs{DTMDate}. Thanks Nicola!
1890 %}
1891 % \begin{macrocode}
1892 ##1\DTMfinaldot{}%
1893 }%
1894 {}%
1895 }%
1896 \renewcommand*\DTMDisplaydate[4]{%
1897 \ifDTMshowdow%
1898 \ifnum##4>-1
1899 \DTMserbianWeekdayname{##4}%
1900 \DTMserbiandowdaysep%
1901 \fi
1902 \fi
1903 \DTMifbool{serbian}{showdayofmonth}
1904 {%
1905 \DTMserbiandayordinal{##3}\DTMserbiandaymonthsep%
1906 \DTMifbool{serbian}{monthi}%
1907 {\DTMserbianimonthname{##2}}%
1908 {\DTMserbiannoimonthname{##2}}%
1909 }%
1910 {%
1911 \DTMifbool{serbian}{monthi}%
1912 {\DTMserbianiMonthname{##2}}%
1913 {\DTMserbiannoiMonthname{##2}}%
1914 }%
1915 \DTMifbool{serbian}{showyear}%
1916 {%
1917 \DTMserbianmonthyearsep%
1918 % \end{macrocode}
1919 %\changes{2.1.0}{2019-11-22}{%
1920 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
1921 % and \cs{DTMDate}. Thanks Nicola!
1922 %}
1923 % \begin{macrocode}
1924 ##1\DTMfinaldot{}%
1925 }%
1926 {}%
1927 }%
1928 }%
1929 {% time style
1930 \renewcommand*\DTMdisplaytime[3]{%
1931 \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
1932 \DTMserbiantimesep\DTMtwodigits{##2}%
1933 \ifDTMshowseconds\DTMserbiantimesep\DTMtwodigits{##3}\fi
1934 }%
1935 }%
1936 {% zone style
1937 \DTMresetzones%
1938 \DTMserbianzonemaps%
1939 \renewcommand*{\DTMdisplayzone}[2]{%
1940 \DTMifbool{serbian}{mapzone}%
1941 {\DTMusezonemapordefault{##1}{##2}}%
1942 {%
1943 \ifnum##1<0
1944 \else+\fi\DTMtwodigits{##1}%
1945 \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
1946 }%
1947 }%
1948 }%
1949 {% full style
1950 \renewcommand*{\DTMdisplay}[9]{%
1951 \ifDTMshowdate%
1952 \DTMdisplaydate{##1}{##2}{##3}{##4}%
1953 \DTMserbiandatetimesep%
1954 \fi
1955 \DTMdisplaytime{##5}{##6}{##7}%
1956 \ifDTMshowzone%
1957 \DTMserbiantimezonesep%
1958 \DTMdisplayzone{##8}{##9}%
1959 \fi
1960 }%
1961 \renewcommand*{\DTMDisplay}[9]{%
1962 \ifDTMshowdate%
1963 \DTMDisplaydate{##1}{##2}{##3}{##4}%
1964 \DTMserbiandatetimesep%
1965 \fi
1966 \DTMdisplaytime{##5}{##6}{##7}%
1967 \ifDTMshowzone%
1968 \DTMserbiantimezonesep%
1969 \DTMdisplayzone{##8}{##9}%
1970 \fi
1971 }%
1972 }%
1973 % \end{macrocode}
1974 %
1975 %
1976 %\begin{macro}{\DTMserbianmonthordinal}
1977 % Define the month ordinal format to be used by this style.
1978 % \begin{macrocode}
1979 \newcommand*{\DTMserbianmonthordinal}[1]{%
1980 \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
1981 % \end{macrocode}
1982 %\end{macro}
1983 %\changes{2.0.0}{2019-11-07}{%
1984 % Added a switch between multiple numeric month ordinal formats used in
1985 % Serbian.
1986 %}
1987 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
1988 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
1989 % Define a setting to switch between Arabic, uppercase Roman and lowercase
1990 % smallcaps Roman month format for the "serbian-numeric" style.
1991 % \begin{macrocode}
1992 \DTMdefchoicekey{serbian}{monthord}%
1993 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
1994 \ifcase\@dtm@nr\relax
1995 \renewcommand*{\DTMserbianmonthordinal}[1]{%
1996 \DTMifbool{serbian}{leadingzero}%
1997 {\DTMtwodigits{##1}}{\number##1}\DTMserbiandatesep}%
1998 \or%
1999 \renewcommand*{\DTMserbianmonthordinal}[1]{%
2000 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
2001 {serbianordinalROMAN{##1}}}%
2002 \or%
2003 \renewcommand*{\DTMserbianmonthordinal}[1]{%
2004 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
2005 {serbianordinalROMAN{##1}}}%
2006 \fi
2007 }
2008 % \end{macrocode}
2009 %\changes{2.0.0}{2019-11-07}{%
2010 % Fixed the (previously entirely wrong) numeric date style.
2011 %}
2012 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2013 %\changes{2.0.0}{2019-11-07}{%
2014 % Added weekday names.
2015 %}
2016 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2017 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2018 % Define numeric style.
2019 % \begin{macrocode}
2020 \DTMnewstyle%
2021 {serbian-numeric}% label
2022 {% date style
2023 \renewcommand*\DTMdisplaydate[4]{%
2024 \ifDTMshowdow%
2025 \ifnum##4>-1
2026 \DTMserbianweekdayname{##4}%
2027 \DTMserbiandowdaysep%
2028 \fi
2029 \fi
2030 \DTMifbool{serbian}{showdayofmonth}%
2031 {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
2032 {}%
2033 \DTMserbianmonthordinal{##2}%
2034 \DTMifbool{serbian}{showyear}%
2035 {%
2036 \DTMserbianmonthyearsep%
2037 % \end{macrocode}
2038 %\changes{2.1.0}{2019-11-22}{%
2039 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2040 % and \cs{DTMDate}. Thanks Nicola!
2041 %}
2042 % \begin{macrocode}
2043 ##1\DTMfinaldot{}%
2044 }%
2045 {}%
2046 }%
2047 \renewcommand*\DTMDisplaydate[4]{%
2048 \ifDTMshowdow%
2049 \ifnum##4>-1
2050 \DTMserbianWeekdayname{##4}%
2051 \DTMserbiandowdaysep%
2052 \fi
2053 \fi
2054 \DTMifbool{serbian}{showdayofmonth}%
2055 {\DTMserbiandayordinal{##3}\DTMserbiandaymonthsep}%
2056 {}%
2057 \DTMserbianmonthordinal{##2}%
2058 \DTMifbool{serbian}{showyear}%
2059 {%
2060 \DTMserbianmonthyearsep%
2061 % \end{macrocode}
2062 %\changes{2.1.0}{2019-11-22}{%
2063 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2064 % and \cs{DTMDate}. Thanks Nicola!
2065 %}
2066 % \begin{macrocode}
2067 ##1\DTMfinaldot{}%
2068 }%
2069 {}%
2070 }%
2071 }%
2072 {% time style
2073 \renewcommand*\DTMdisplaytime[3]{%
2074 \DTMifbool{serbian}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
2075 \DTMserbiantimesep\DTMtwodigits{##2}%
2076 \ifDTMshowseconds\DTMserbiantimesep\DTMtwodigits{##3}\fi
2077 }%
2078 }%
2079 {% zone style
2080 \DTMresetzones%
2081 \DTMserbianzonemaps%
2082 \renewcommand*{\DTMdisplayzone}[2]{%
2083 \DTMifbool{serbian}{mapzone}%
2084 {\DTMusezonemapordefault{##1}{##2}}%
2085 {%
2086 \ifnum##1<0
2087 \else+\fi\DTMtwodigits{##1}%
2088 \ifDTMshowzoneminutes\DTMserbiantimesep\DTMtwodigits{##2}\fi
2089 }%
2090 }%
2091 }%
2092 {% full style
2093 \renewcommand*{\DTMdisplay}[9]{%
2094 \ifDTMshowdate%
2095 \DTMdisplaydate{##1}{##2}{##3}{##4}%
2096 \DTMserbiandatetimesep%
2097 \fi
2098 \DTMdisplaytime{##5}{##6}{##7}%
2099 \ifDTMshowzone%
2100 \DTMserbiantimezonesep%
2101 \DTMdisplayzone{##8}{##9}%
2102 \fi
2103 }%
2104 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
2105 }
2106 % \end{macrocode}
2107 %
2108 %\begin{macro}{\DTMserbianzonemaps}
2109 % The time zone mappings are set through this command, which can be
2110 % redefined if extra mappings are required or mappings need to be
2111 % removed.
2112 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
2113 % \begin{macrocode}
2114 \newcommand*{\DTMserbianzonemaps}{%
2115 \DTMdefzonemap{01}{00}{CET}%
2116 \DTMdefzonemap{02}{00}{CEST}%
2117 }
2118 % \end{macrocode}
2119 %\end{macro}
2120 % Switch style according to the \opt{useregional} setting.
2121 % \begin{macrocode}
2122 \DTMifcaseregional%
2123 {}% do nothing
2124 {\DTMsetstyle{serbian}}%
2125 {\DTMsetstyle{serbian-numeric}}%
2126 % \end{macrocode}
2127 % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent
2128 % \sty{babel} from resetting \cs{today}. (For this to work,
2129 % \sty{babel} must already have been loaded if it's required.)
2130 %\changes{1.1}{2019-09-14}{removed spurious space}
2131 %\changes{2.0.0}{2019-11-07}{%
2132 % Added regions.
2133 %}
2134 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2135 % \begin{macrocode}
2136 \ifcsundef{date\CurrentTrackedDialect}
2137 {%
2138 \ifundef\dateserbian%
2139 {% do nothing
2140 }%
2141 {%
2142 \def\dateserbian{%
2143 \DTMifcaseregional%
2144 {}% do nothing
2145 {\DTMsetstyle{serbian}}%
2146 {\DTMsetstyle{serbian-numeric}}%
2147 }%
2148 }%
2149 }%
2150 {%
2151 \csdef{date\CurrentTrackedDialect}{%
2152 \DTMifcaseregional%
2153 {}% do nothing
2154 % \end{macrocode}
2155 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
2156 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
2157 % \begin{macrocode}
2158 {\DTMsetstyle{serbian}}%
2159 {\DTMsetstyle{serbian-numeric}}%
2160 }%
2161 }%
2162 % \end{macrocode}
2163 %
2164 %\iffalse
2165 % \begin{macrocode}
2166 %</datetime2-serbian.ldf>
2167 % \end{macrocode}
2168 %\fi
2169 %
2170 %\iffalse
2171 % \begin{macrocode}
2172 %<*datetime2-sr-Latn.ldf>
2173 % \end{macrocode}
2174 %\fi
2175 %
2176 %\subsection{Serbian \sty{sr-Latn} Code
2177 % (\texttt{datetime2-sr-Latn.ldf})}
2178 %\changes{1.0}{2015-03-24}{Initial release}
2179 %\changes{2.0.0}{2019-11-07}{%
2180 % Added regions, all settings made available to regions so all changes can be
2181 % region-specific.
2182 %}
2183 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2184 % \begin{macrocode}
2185 \ProvidesDateTimeModule{sr-Latn}[2019/11/22 v2.1.0]
2186 % \end{macrocode}
2187 %\changes{2.0.0}{2019-11-07}{%
2188 % All localization strings loaded from base module.
2189 %}
2190 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2191 % Load appropriate regionless Serbian module.
2192 % \begin{macrocode}
2193 \RequireDateTimeModule{serbian}
2194 % \end{macrocode}
2195 %
2196 %
2197 %
2198 %\subsubsection{Defining the \sty{sr-Latn} style}
2199 %
2200 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2201 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
2202 % Allow the user a way of configuring the "sr-Latn" and
2203 % "sr-Latn-numeric" styles by providing macros for various format
2204 % elements.
2205 %
2206 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
2207 % case other date formats are also required.
2208 %
2209 %\begin{macro}{\DTMsrLatndowdaysep}
2210 % The separator between weekday and day.
2211 % \begin{macrocode}
2212 \newcommand*{\DTMsrLatndowdaysep}{,\space}
2213 % \end{macrocode}
2214 %\end{macro}
2215 %
2216 %
2217 %\begin{macro}{\DTMsrLatndaymonthsep}
2218 % The separator between the day and month for the text format.
2219 % \begin{macrocode}
2220 \newcommand*{\DTMsrLatndaymonthsep}{%
2221 \DTMtexorpdfstring{\protect~}{\space}%
2222 }
2223 % \end{macrocode}
2224 %\end{macro}
2225 %
2226 %\begin{macro}{\DTMsrLatnmonthyearsep}
2227 % The separator between the month and year for the text format.
2228 % \begin{macrocode}
2229 \newcommand*{\DTMsrLatnmonthyearsep}{\space}
2230 % \end{macrocode}
2231 %\end{macro}
2232 %
2233 %\begin{macro}{\DTMsrLatndatetimesep}
2234 % The separator between the date and time blocks in the full format (either
2235 % text or numeric).
2236 % \begin{macrocode}
2237 \newcommand*{\DTMsrLatndatetimesep}{\space}
2238 % \end{macrocode}
2239 %\end{macro}
2240 %
2241 %\begin{macro}{\DTMsrLatntimezonesep}
2242 % The separator between the time and zone blocks in the full format (either
2243 % text or numeric).
2244 % \begin{macrocode}
2245 \newcommand*{\DTMsrLatntimezonesep}{\space}
2246 % \end{macrocode}
2247 %\end{macro}
2248 %
2249 %\begin{macro}{\DTMsrLatndatesep}
2250 % The separator for the numeric date format.
2251 % \begin{macrocode}
2252 \newcommand*{\DTMsrLatndatesep}{.}
2253 % \end{macrocode}
2254 %\end{macro}
2255 %
2256 %\begin{macro}{\DTMsrLatntimesep}
2257 % The separator for the numeric time format.
2258 % \begin{macrocode}
2259 \newcommand*{\DTMsrLatntimesep}{.}
2260 % \end{macrocode}
2261 %\end{macro}
2262 %
2263 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
2264 % \begin{macrocode}
2265 \DTMdefkey{sr-Latn}{dowdaysep}%
2266 {\renewcommand*{\DTMsr-Latndowdaysep}{#1}}
2267 \DTMdefkey{sr-Latn}{daymonthsep}%
2268 {\renewcommand*{\DTMsr-Latndaymonthsep}{#1}}
2269 \DTMdefkey{sr-Latn}{monthyearsep}%
2270 {\renewcommand*{\DTMsr-Latnmonthyearsep}{#1}}
2271 \DTMdefkey{sr-Latn}{datetimesep}%
2272 {\renewcommand*{\DTMsr-Latndatetimesep}{#1}}
2273 \DTMdefkey{sr-Latn}{timezonesep}%
2274 {\renewcommand*{\DTMsr-Latntimezonesep}{#1}}
2275 \DTMdefkey{sr-Latn}{datesep}%
2276 {\renewcommand*{\DTMsr-Latndatesep}{#1}}
2277 \DTMdefkey{sr-Latn}{timesep}%
2278 {\renewcommand*{\DTMsr-Latntimesep}{#1}}
2279 % \end{macrocode}
2280 %
2281 %\subsubsection{Switches and settings}
2282 %
2283 %\changes{2.0.0}{2019-11-07}{%
2284 % Added weekday names.
2285 %}
2286 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2287 %\begin{macro}{\DTMsrLatnweekdayname}
2288 % Define the weekday name, lowercase.
2289 % \begin{macrocode}
2290 \newcommand*{\DTMsrLatnweekdayname}%
2291 {\DTMserbianlatekweekdayname}
2292 % \end{macrocode}
2293 %\end{macro}
2294
2295 %\begin{macro}{\DTMsrLatnweekdayname}
2296 % Define the weekday name, capitalized.
2297 % \begin{macrocode}
2298 \newcommand*{\DTMsrLatnWeekdayname}%
2299 {\DTMserbianlatekWeekdayname}
2300 % \end{macrocode}
2301 %\end{macro}
2302 %
2303 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
2304 %\changes{2.0.0}{2019-11-07}{%
2305 % Added a way to switch between Ekavian and Ijekavian pronunciation.
2306 %}
2307 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2308 %
2309 % \begin{macrocode}
2310 \DTMdefchoicekey{sr-Latn}%
2311 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
2312 \ifcase\@dtm@nr\relax
2313 \renewcommand*{\DTMsrLatnweekdayname}%
2314 {\DTMserbianlatekweekdayname}%
2315 \renewcommand*{\DTMsrLatnWeekdayname}%
2316 {\DTMserbianlatekWeekdayname}%
2317 \or%
2318 \renewcommand*{\DTMsrLatnweekdayname}%
2319 {\DTMserbianlatijweekdayname}%
2320 \renewcommand*{\DTMsrLatnWeekdayname}
2321 {\DTMserbianlatijWeekdayname}%
2322 \fi
2323 }
2324 % \end{macrocode}
2325 %\changes{2.0.0}{2019-11-07}{%
2326 % Added a way to switch June, July alternate spellings.
2327 %}
2328 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2329 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2330 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
2331 % month spellings.
2332 % \begin{macrocode}
2333 \DTMdefboolkey{sr-Latn}{monthi}[true]{}
2334 % \end{macrocode}
2335 % The default is without the "i" suffix.
2336 % \begin{macrocode}
2337 \DTMsetbool{sr-Latn}{monthi}{false}
2338 % \end{macrocode}
2339 %\changes{2.0.0}{2019-11-07}{%
2340 % Added a switch for adding leading zeroes in day and month ordinals.
2341 %}
2342 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2343 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2344 % Define a boolean key that determines if the day and month ordinals should
2345 % have leading zeroes.
2346 % \begin{macrocode}
2347 \DTMdefboolkey{sr-Latn}{leadingzero}[true]{}
2348 % \end{macrocode}
2349 % The default is to omit the leading zero.
2350 % \begin{macrocode}
2351 \DTMsetbool{sr-Latn}{leadingzero}{false}
2352 % \end{macrocode}
2353 %
2354 %\begin{macro}{\DTMsrLatndayordinal}
2355 % Define the day ordinal format to be used by this style.
2356 % \begin{macrocode}
2357 \newcommand*{\DTMsrLatndayordinal}[1]{%
2358 \DTMifbool{sr-Latn}{leadingzero}%
2359 {\DTMtwodigits{#1}}%
2360 {\number#1}\DTMsrLatndatesep}%
2361 % \end{macrocode}
2362 %\end{macro}
2363 %
2364 %\changes{2.1.0}{2019-11-22}{%
2365 % Removed year ordinal macro since year ordinals are handled differently now.
2366 %}
2367 %\changes{2.0.0}{2019-11-07}{%
2368 % Removed the option to switch between writing systems, since that is
2369 % accomplished by using different regions or regionless styles ("serbian" and
2370 % "serbianc" for example).
2371 %}
2372 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2373 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2374 % Define the month names.
2375 %
2376 %\begin{macro}{\DTMsrLatnnoimonthname}
2377 % \begin{macrocode}
2378 \newcommand*{\DTMsrLatnnoimonthname}{\DTMserbianlatnoimonthname}
2379 % \end{macrocode}
2380 %\end{macro}
2381 %
2382 %\begin{macro}{\DTMsrLatnnoiMonthname}
2383 % \begin{macrocode}
2384 \newcommand*{\DTMsrLatnnoiMonthname}{\DTMserbianlatnoiMonthname}
2385 % \end{macrocode}
2386 %\end{macro}
2387 %
2388 %\begin{macro}{\DTMsrLatnimonthname}
2389 % \begin{macrocode}
2390 \newcommand*{\DTMsrLatnimonthname}{\DTMserbianlatimonthname}
2391 % \end{macrocode}
2392 %\end{macro}
2393 %
2394 %\begin{macro}{\DTMsrLatniMonthname}
2395 % \begin{macrocode}
2396 \newcommand*{\DTMsrLatniMonthname}{\DTMserbianlatiMonthname}
2397 % \end{macrocode}
2398 %\end{macro}
2399 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2400 % Define a boolean key that determines if the time zone mappings
2401 % should be used.
2402 % \begin{macrocode}
2403 \DTMdefboolkey{sr-Latn}{mapzone}[true]{}
2404 % \end{macrocode}
2405 % The default is to use mappings.
2406 % \begin{macrocode}
2407 \DTMsetbool{sr-Latn}{mapzone}{true}
2408 % \end{macrocode}
2409 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2410 % Define a boolean key that determines if the day of month should be
2411 % displayed.
2412 % \begin{macrocode}
2413 \DTMdefboolkey{sr-Latn}{showdayofmonth}[true]{}
2414 % \end{macrocode}
2415 % The default is to show the day of month.
2416 % \begin{macrocode}
2417 \DTMsetbool{sr-Latn}{showdayofmonth}{true}
2418 % \end{macrocode}
2419 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2420 % Define a boolean key that determines if the year should be
2421 % displayed.
2422 % \begin{macrocode}
2423 \DTMdefboolkey{sr-Latn}{showyear}[true]{}
2424 % \end{macrocode}
2425 % The default is to show the year.
2426 % \begin{macrocode}
2427 \DTMsetbool{sr-Latn}{showyear}{true}
2428 % \end{macrocode}
2429 %\changes{2.0.0}{2019-11-07}{%
2430 % Added weekday names.
2431 %}
2432 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2433 % \begin{macrocode}
2434 \DTMnewstyle%
2435 {sr-Latn}% label
2436 {% date style
2437 \renewcommand*\DTMdisplaydate[4]{%
2438 \ifDTMshowdow%
2439 \ifnum##4>-1
2440 \DTMsrLatnweekdayname{##4}%
2441 \DTMsrLatndowdaysep%
2442 \fi
2443 \fi
2444 \DTMifbool{sr-Latn}{showdayofmonth}
2445 {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
2446 {}%
2447 \DTMifbool{sr-Latn}{monthi}%
2448 {\DTMsrLatnimonthname{##2}}%
2449 {\DTMsrLatnnoimonthname{##2}}%
2450 \DTMifbool{sr-Latn}{showyear}%
2451 {%
2452 \DTMsrLatnmonthyearsep%
2453 % \end{macrocode}
2454 %\changes{2.1.0}{2019-11-22}{%
2455 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2456 % and \cs{DTMDate}. Thanks Nicola!
2457 %}
2458 % \begin{macrocode}
2459 ##1\DTMfinaldot{}%
2460 }%
2461 {}%
2462 }%
2463 \renewcommand*\DTMDisplaydate[4]{%
2464 \ifDTMshowdow%
2465 \ifnum##4>-1
2466 \DTMsrLatnWeekdayname{##4}%
2467 \DTMsrLatndowdaysep%
2468 \fi
2469 \fi
2470 \DTMifbool{sr-Latn}{showdayofmonth}
2471 {%
2472 \DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep%
2473 \DTMifbool{sr-Latn}{monthi}%
2474 {\DTMsrLatnimonthname{##2}}%
2475 {\DTMsrLatnnoimonthname{##2}}%
2476 }%
2477 {%
2478 \DTMifbool{sr-Latn}{monthi}%
2479 {\DTMsrLatniMonthname{##2}}%
2480 {\DTMsrLatnnoiMonthname{##2}}%
2481 }%
2482 \DTMifbool{sr-Latn}{showyear}%
2483 {%
2484 \DTMsrLatnmonthyearsep%
2485 % \end{macrocode}
2486 %\changes{2.1.0}{2019-11-22}{%
2487 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2488 % and \cs{DTMDate}. Thanks Nicola!
2489 %}
2490 % \begin{macrocode}
2491 ##1\DTMfinaldot{}%
2492 }%
2493 {}%
2494 }%
2495 }%
2496 {% time style
2497 \renewcommand*\DTMdisplaytime[3]{%
2498 \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
2499 \DTMsrLatntimesep\DTMtwodigits{##2}%
2500 \ifDTMshowseconds\DTMsrLatntimesep\DTMtwodigits{##3}\fi
2501 }%
2502 }%
2503 {% zone style
2504 \DTMresetzones%
2505 \DTMsrLatnzonemaps%
2506 \renewcommand*{\DTMdisplayzone}[2]{%
2507 \DTMifbool{sr-Latn}{mapzone}%
2508 {\DTMusezonemapordefault{##1}{##2}}%
2509 {%
2510 \ifnum##1<0
2511 \else+\fi\DTMtwodigits{##1}%
2512 \ifDTMshowzoneminutes\DTMsrLatntimesep\DTMtwodigits{##2}\fi
2513 }%
2514 }%
2515 }%
2516 {% full style
2517 \renewcommand*{\DTMdisplay}[9]{%
2518 \ifDTMshowdate%
2519 \DTMdisplaydate{##1}{##2}{##3}{##4}%
2520 \DTMsrLatndatetimesep%
2521 \fi
2522 \DTMdisplaytime{##5}{##6}{##7}%
2523 \ifDTMshowzone%
2524 \DTMsrLatntimezonesep%
2525 \DTMdisplayzone{##8}{##9}%
2526 \fi
2527 }%
2528 \renewcommand*{\DTMDisplay}[9]{%
2529 \ifDTMshowdate%
2530 \DTMDisplaydate{##1}{##2}{##3}{##4}%
2531 \DTMsrLatndatetimesep%
2532 \fi
2533 \DTMdisplaytime{##5}{##6}{##7}%
2534 \ifDTMshowzone%
2535 \DTMsrLatntimezonesep%
2536 \DTMdisplayzone{##8}{##9}%
2537 \fi
2538 }%
2539 }%
2540 % \end{macrocode}
2541 %
2542 %
2543 %\begin{macro}{\DTMsrLatnmonthordinal}
2544 % Define the month ordinal format to be used by this style.
2545 % \begin{macrocode}
2546 \newcommand*{\DTMsrLatnmonthordinal}[1]{%
2547 \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
2548 % \end{macrocode}
2549 %\end{macro}
2550 %\changes{2.0.0}{2019-11-07}{%
2551 % Added a switch between multiple numeric month ordinal formats used in
2552 % Serbian.
2553 %}
2554 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2555 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2556 % Define a setting to switch between Arabic, uppercase Roman and lowercase
2557 % smallcaps Roman month format for the "srLatn-numeric" style.
2558 % \begin{macrocode}
2559 \DTMdefchoicekey{sr-Latn}{monthord}%
2560 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
2561 \ifcase\@dtm@nr\relax
2562 \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
2563 \DTMifbool{sr-Latn}{leadingzero}%
2564 {\DTMtwodigits{##1}}{\number##1}\DTMsrLatndatesep}%
2565 \or%
2566 \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
2567 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
2568 {serbianordinalROMAN{##1}}}%
2569 \or%
2570 \renewcommand*{\DTMsrLatnmonthordinal}[1]{%
2571 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
2572 {serbianordinalROMAN{##1}}}%
2573 \fi
2574 }
2575 % \end{macrocode}
2576 %\changes{2.0.0}{2019-11-07}{%
2577 % Fixed the (previously entirely wrong) numeric date style.
2578 %}
2579 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2580 %\changes{2.0.0}{2019-11-07}{%
2581 % Added weekday names.
2582 %}
2583 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2584 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2585 % Define numeric style.
2586 % \begin{macrocode}
2587 \DTMnewstyle%
2588 {sr-Latn-numeric}% label
2589 {% date style
2590 \renewcommand*\DTMdisplaydate[4]{%
2591 \ifDTMshowdow%
2592 \ifnum##4>-1
2593 \DTMsrLatnweekdayname{##4}%
2594 \DTMsrLatndowdaysep%
2595 \fi
2596 \fi
2597 \DTMifbool{sr-Latn}{showdayofmonth}%
2598 {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
2599 {}%
2600 \DTMsrLatnmonthordinal{##2}%
2601 \DTMifbool{sr-Latn}{showyear}%
2602 {%
2603 \DTMsrLatnmonthyearsep%
2604 % \end{macrocode}
2605 %\changes{2.1.0}{2019-11-22}{%
2606 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2607 % and \cs{DTMDate}. Thanks Nicola!
2608 %}
2609 % \begin{macrocode}
2610 ##1\DTMfinaldot{}%
2611 }%
2612 {}%
2613 }%
2614 \renewcommand*\DTMDisplaydate[4]{%
2615 \ifDTMshowdow%
2616 \ifnum##4>-1
2617 \DTMsrLatnWeekdayname{##4}%
2618 \DTMsrLatndowdaysep%
2619 \fi
2620 \fi
2621 \DTMifbool{sr-Latn}{showdayofmonth}%
2622 {\DTMsrLatndayordinal{##3}\DTMsrLatndaymonthsep}%
2623 {}%
2624 \DTMsrLatnmonthordinal{##2}%
2625 \DTMifbool{sr-Latn}{showyear}%
2626 {%
2627 \DTMsrLatnmonthyearsep%
2628 % \end{macrocode}
2629 %\changes{2.1.0}{2019-11-22}{%
2630 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
2631 % and \cs{DTMDate}. Thanks Nicola!
2632 %}
2633 % \begin{macrocode}
2634 ##1\DTMfinaldot{}%
2635 }%
2636 {}%
2637 }%
2638 }%
2639 {% time style
2640 \renewcommand*\DTMdisplaytime[3]{%
2641 \DTMifbool{sr-Latn}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
2642 \DTMsrLatntimesep\DTMtwodigits{##2}%
2643 \ifDTMshowseconds\DTMsrLatntimesep\DTMtwodigits{##3}\fi
2644 }%
2645 }%
2646 {% zone style
2647 \DTMresetzones%
2648 \DTMsrLatnzonemaps%
2649 \renewcommand*{\DTMdisplayzone}[2]{%
2650 \DTMifbool{sr-Latn}{mapzone}%
2651 {\DTMusezonemapordefault{##1}{##2}}%
2652 {%
2653 \ifnum##1<0
2654 \else+\fi\DTMtwodigits{##1}%
2655 \ifDTMshowzoneminutes\DTMsrLatntimesep\DTMtwodigits{##2}\fi
2656 }%
2657 }%
2658 }%
2659 {% full style
2660 \renewcommand*{\DTMdisplay}[9]{%
2661 \ifDTMshowdate%
2662 \DTMdisplaydate{##1}{##2}{##3}{##4}%
2663 \DTMsrLatndatetimesep%
2664 \fi
2665 \DTMdisplaytime{##5}{##6}{##7}%
2666 \ifDTMshowzone%
2667 \DTMsrLatntimezonesep%
2668 \DTMdisplayzone{##8}{##9}%
2669 \fi
2670 }%
2671 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
2672 }
2673 % \end{macrocode}
2674 %
2675 %\begin{macro}{\DTMsr-Latnzonemaps}
2676 % The time zone mappings are set through this command, which can be
2677 % redefined if extra mappings are required or mappings need to be
2678 % removed.
2679 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
2680 % \begin{macrocode}
2681 \newcommand*{\DTMsrLatnzonemaps}{%
2682 \DTMdefzonemap{01}{00}{CET}%
2683 \DTMdefzonemap{02}{00}{CEST}%
2684 }
2685 % \end{macrocode}
2686 %\end{macro}
2687 % Switch style according to the \opt{useregional} setting.
2688 % \begin{macrocode}
2689 \DTMifcaseregional%
2690 {}% do nothing
2691 {\DTMsetstyle{sr-Latn}}%
2692 {\DTMsetstyle{sr-Latn-numeric}}%
2693 % \end{macrocode}
2694 % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent
2695 % \sty{babel} from resetting \cs{today}. (For this to work,
2696 % \sty{babel} must already have been loaded if it's required.)
2697 %\changes{1.1}{2019-09-14}{removed spurious space}
2698 %\changes{2.0.0}{2019-11-07}{%
2699 % Added regions.
2700 %}
2701 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2702 % \begin{macrocode}
2703 \ifcsundef{date\CurrentTrackedDialect}
2704 {%
2705 \ifundef\dateserbian%
2706 {% do nothing
2707 }%
2708 {%
2709 \def\dateserbian{%
2710 \DTMifcaseregional%
2711 {}% do nothing
2712 {\DTMsetstyle{sr-Latn}}%
2713 {\DTMsetstyle{sr-Latn-numeric}}%
2714 }%
2715 }%
2716 }%
2717 {%
2718 \csdef{date\CurrentTrackedDialect}{%
2719 \DTMifcaseregional%
2720 {}% do nothing
2721 % \end{macrocode}
2722 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
2723 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
2724 % \begin{macrocode}
2725 {\DTMsetstyle{sr-Latn}}%
2726 {\DTMsetstyle{sr-Latn-numeric}}%
2727 }%
2728 }%
2729 % \end{macrocode}
2730 %
2731 %\iffalse
2732 % \begin{macrocode}
2733 %</datetime2-sr-Latn.ldf>
2734 % \end{macrocode}
2735 %\fi
2736 %
2737 %\iffalse
2738 % \begin{macrocode}
2739 %<*datetime2-sr-Latn-RS.ldf>
2740 % \end{macrocode}
2741 %\fi
2742 %
2743 %\subsection{Serbian \sty{sr-Latn-RS} Code
2744 % (\texttt{datetime2-sr-Latn-RS.ldf})}
2745 %\changes{1.0}{2015-03-24}{Initial release}
2746 %\changes{2.0.0}{2019-11-07}{%
2747 % Added regions, all settings made available to regions so all changes can be
2748 % region-specific.
2749 %}
2750 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2751 % \begin{macrocode}
2752 \ProvidesDateTimeModule{sr-Latn-RS}[2019/11/22 v2.1.0]
2753 % \end{macrocode}
2754 %\changes{2.0.0}{2019-11-07}{%
2755 % All localization strings loaded from base module.
2756 %}
2757 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2758 % Load appropriate regionless Serbian module.
2759 % \begin{macrocode}
2760 \RequireDateTimeModule{serbian}
2761 % \end{macrocode}
2762 %
2763 %
2764 %
2765 %\subsubsection{Defining the \sty{sr-Latn-RS} style}
2766 %
2767 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2768 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
2769 % Allow the user a way of configuring the "sr-Latn-RS" and
2770 % "sr-Latn-RS-numeric" styles by providing macros for various format
2771 % elements.
2772 %
2773 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
2774 % case other date formats are also required.
2775 %
2776 %\begin{macro}{\DTMsrLatnRSdowdaysep}
2777 % The separator between weekday and day.
2778 % \begin{macrocode}
2779 \newcommand*{\DTMsrLatnRSdowdaysep}{,\space}
2780 % \end{macrocode}
2781 %\end{macro}
2782 %
2783 %
2784 %\begin{macro}{\DTMsrLatnRSdaymonthsep}
2785 % The separator between the day and month for the text format.
2786 % \begin{macrocode}
2787 \newcommand*{\DTMsrLatnRSdaymonthsep}{%
2788 \DTMtexorpdfstring{\protect~}{\space}%
2789 }
2790 % \end{macrocode}
2791 %\end{macro}
2792 %
2793 %\begin{macro}{\DTMsrLatnRSmonthyearsep}
2794 % The separator between the month and year for the text format.
2795 % \begin{macrocode}
2796 \newcommand*{\DTMsrLatnRSmonthyearsep}{\space}
2797 % \end{macrocode}
2798 %\end{macro}
2799 %
2800 %\begin{macro}{\DTMsrLatnRSdatetimesep}
2801 % The separator between the date and time blocks in the full format (either
2802 % text or numeric).
2803 % \begin{macrocode}
2804 \newcommand*{\DTMsrLatnRSdatetimesep}{\space}
2805 % \end{macrocode}
2806 %\end{macro}
2807 %
2808 %\begin{macro}{\DTMsrLatnRStimezonesep}
2809 % The separator between the time and zone blocks in the full format (either
2810 % text or numeric).
2811 % \begin{macrocode}
2812 \newcommand*{\DTMsrLatnRStimezonesep}{\space}
2813 % \end{macrocode}
2814 %\end{macro}
2815 %
2816 %\begin{macro}{\DTMsrLatnRSdatesep}
2817 % The separator for the numeric date format.
2818 % \begin{macrocode}
2819 \newcommand*{\DTMsrLatnRSdatesep}{.}
2820 % \end{macrocode}
2821 %\end{macro}
2822 %
2823 %\begin{macro}{\DTMsrLatnRStimesep}
2824 % The separator for the numeric time format.
2825 % \begin{macrocode}
2826 \newcommand*{\DTMsrLatnRStimesep}{.}
2827 % \end{macrocode}
2828 %\end{macro}
2829 %
2830 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
2831 % \begin{macrocode}
2832 \DTMdefkey{sr-Latn-RS}{dowdaysep}%
2833 {\renewcommand*{\DTMsr-Latn-RSdowdaysep}{#1}}
2834 \DTMdefkey{sr-Latn-RS}{daymonthsep}%
2835 {\renewcommand*{\DTMsr-Latn-RSdaymonthsep}{#1}}
2836 \DTMdefkey{sr-Latn-RS}{monthyearsep}%
2837 {\renewcommand*{\DTMsr-Latn-RSmonthyearsep}{#1}}
2838 \DTMdefkey{sr-Latn-RS}{datetimesep}%
2839 {\renewcommand*{\DTMsr-Latn-RSdatetimesep}{#1}}
2840 \DTMdefkey{sr-Latn-RS}{timezonesep}%
2841 {\renewcommand*{\DTMsr-Latn-RStimezonesep}{#1}}
2842 \DTMdefkey{sr-Latn-RS}{datesep}%
2843 {\renewcommand*{\DTMsr-Latn-RSdatesep}{#1}}
2844 \DTMdefkey{sr-Latn-RS}{timesep}%
2845 {\renewcommand*{\DTMsr-Latn-RStimesep}{#1}}
2846 % \end{macrocode}
2847 %
2848 %\subsubsection{Switches and settings}
2849 %
2850 %\changes{2.0.0}{2019-11-07}{%
2851 % Added weekday names.
2852 %}
2853 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2854 %\begin{macro}{\DTMsrLatnRSweekdayname}
2855 % Define the weekday name, lowercase.
2856 % \begin{macrocode}
2857 \newcommand*{\DTMsrLatnRSweekdayname}%
2858 {\DTMserbianlatekweekdayname}
2859 % \end{macrocode}
2860 %\end{macro}
2861
2862 %\begin{macro}{\DTMsrLatnRSweekdayname}
2863 % Define the weekday name, capitalized.
2864 % \begin{macrocode}
2865 \newcommand*{\DTMsrLatnRSWeekdayname}%
2866 {\DTMserbianlatekWeekdayname}
2867 % \end{macrocode}
2868 %\end{macro}
2869 %
2870 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
2871 %\changes{2.0.0}{2019-11-07}{%
2872 % Added a way to switch between Ekavian and Ijekavian pronunciation.
2873 %}
2874 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2875 %
2876 % \begin{macrocode}
2877 \DTMdefchoicekey{sr-Latn-RS}%
2878 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
2879 \ifcase\@dtm@nr\relax
2880 \renewcommand*{\DTMsrLatnRSweekdayname}%
2881 {\DTMserbianlatekweekdayname}%
2882 \renewcommand*{\DTMsrLatnRSWeekdayname}%
2883 {\DTMserbianlatekWeekdayname}%
2884 \or%
2885 \renewcommand*{\DTMsrLatnRSweekdayname}%
2886 {\DTMserbianlatijweekdayname}%
2887 \renewcommand*{\DTMsrLatnRSWeekdayname}
2888 {\DTMserbianlatijWeekdayname}%
2889 \fi
2890 }
2891 % \end{macrocode}
2892 %\changes{2.0.0}{2019-11-07}{%
2893 % Added a way to switch June, July alternate spellings.
2894 %}
2895 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2896 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2897 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
2898 % month spellings.
2899 % \begin{macrocode}
2900 \DTMdefboolkey{sr-Latn-RS}{monthi}[true]{}
2901 % \end{macrocode}
2902 % The default is without the "i" suffix.
2903 % \begin{macrocode}
2904 \DTMsetbool{sr-Latn-RS}{monthi}{false}
2905 % \end{macrocode}
2906 %\changes{2.0.0}{2019-11-07}{%
2907 % Added a switch for adding leading zeroes in day and month ordinals.
2908 %}
2909 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2910 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2911 % Define a boolean key that determines if the day and month ordinals should
2912 % have leading zeroes.
2913 % \begin{macrocode}
2914 \DTMdefboolkey{sr-Latn-RS}{leadingzero}[true]{}
2915 % \end{macrocode}
2916 % The default is to omit the leading zero.
2917 % \begin{macrocode}
2918 \DTMsetbool{sr-Latn-RS}{leadingzero}{false}
2919 % \end{macrocode}
2920 %
2921 %\begin{macro}{\DTMsrLatnRSdayordinal}
2922 % Define the day ordinal format to be used by this style.
2923 % \begin{macrocode}
2924 \newcommand*{\DTMsrLatnRSdayordinal}[1]{%
2925 \DTMifbool{sr-Latn-RS}{leadingzero}%
2926 {\DTMtwodigits{#1}}%
2927 {\number#1}\DTMsrLatnRSdatesep}%
2928 % \end{macrocode}
2929 %\end{macro}
2930 %
2931 %\changes{2.1.0}{2019-11-22}{%
2932 % Removed year ordinal macro since year ordinals are handled differently now.
2933 %}
2934 %\changes{2.0.0}{2019-11-07}{%
2935 % Removed the option to switch between writing systems, since that is
2936 % accomplished by using different regions or regionless styles ("serbian" and
2937 % "serbianc" for example).
2938 %}
2939 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
2940 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2941 % Define the month names.
2942 %
2943 %\begin{macro}{\DTMsrLatnRSnoimonthname}
2944 % \begin{macrocode}
2945 \newcommand*{\DTMsrLatnRSnoimonthname}{\DTMserbianlatnoimonthname}
2946 % \end{macrocode}
2947 %\end{macro}
2948 %
2949 %\begin{macro}{\DTMsrLatnRSnoiMonthname}
2950 % \begin{macrocode}
2951 \newcommand*{\DTMsrLatnRSnoiMonthname}{\DTMserbianlatnoiMonthname}
2952 % \end{macrocode}
2953 %\end{macro}
2954 %
2955 %\begin{macro}{\DTMsrLatnRSimonthname}
2956 % \begin{macrocode}
2957 \newcommand*{\DTMsrLatnRSimonthname}{\DTMserbianlatimonthname}
2958 % \end{macrocode}
2959 %\end{macro}
2960 %
2961 %\begin{macro}{\DTMsrLatnRSiMonthname}
2962 % \begin{macrocode}
2963 \newcommand*{\DTMsrLatnRSiMonthname}{\DTMserbianlatiMonthname}
2964 % \end{macrocode}
2965 %\end{macro}
2966 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2967 % Define a boolean key that determines if the time zone mappings
2968 % should be used.
2969 % \begin{macrocode}
2970 \DTMdefboolkey{sr-Latn-RS}{mapzone}[true]{}
2971 % \end{macrocode}
2972 % The default is to use mappings.
2973 % \begin{macrocode}
2974 \DTMsetbool{sr-Latn-RS}{mapzone}{true}
2975 % \end{macrocode}
2976 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2977 % Define a boolean key that determines if the day of month should be
2978 % displayed.
2979 % \begin{macrocode}
2980 \DTMdefboolkey{sr-Latn-RS}{showdayofmonth}[true]{}
2981 % \end{macrocode}
2982 % The default is to show the day of month.
2983 % \begin{macrocode}
2984 \DTMsetbool{sr-Latn-RS}{showdayofmonth}{true}
2985 % \end{macrocode}
2986 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
2987 % Define a boolean key that determines if the year should be
2988 % displayed.
2989 % \begin{macrocode}
2990 \DTMdefboolkey{sr-Latn-RS}{showyear}[true]{}
2991 % \end{macrocode}
2992 % The default is to show the year.
2993 % \begin{macrocode}
2994 \DTMsetbool{sr-Latn-RS}{showyear}{true}
2995 % \end{macrocode}
2996 %\changes{2.0.0}{2019-11-07}{%
2997 % Added weekday names.
2998 %}
2999 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3000 % \begin{macrocode}
3001 \DTMnewstyle%
3002 {sr-Latn-RS}% label
3003 {% date style
3004 \renewcommand*\DTMdisplaydate[4]{%
3005 \ifDTMshowdow%
3006 \ifnum##4>-1
3007 \DTMsrLatnRSweekdayname{##4}%
3008 \DTMsrLatnRSdowdaysep%
3009 \fi
3010 \fi
3011 \DTMifbool{sr-Latn-RS}{showdayofmonth}
3012 {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
3013 {}%
3014 \DTMifbool{sr-Latn-RS}{monthi}%
3015 {\DTMsrLatnRSimonthname{##2}}%
3016 {\DTMsrLatnRSnoimonthname{##2}}%
3017 \DTMifbool{sr-Latn-RS}{showyear}%
3018 {%
3019 \DTMsrLatnRSmonthyearsep%
3020 % \end{macrocode}
3021 %\changes{2.1.0}{2019-11-22}{%
3022 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3023 % and \cs{DTMDate}. Thanks Nicola!
3024 %}
3025 % \begin{macrocode}
3026 ##1\DTMfinaldot{}%
3027 }%
3028 {}%
3029 }%
3030 \renewcommand*\DTMDisplaydate[4]{%
3031 \ifDTMshowdow%
3032 \ifnum##4>-1
3033 \DTMsrLatnRSWeekdayname{##4}%
3034 \DTMsrLatnRSdowdaysep%
3035 \fi
3036 \fi
3037 \DTMifbool{sr-Latn-RS}{showdayofmonth}
3038 {%
3039 \DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep%
3040 \DTMifbool{sr-Latn-RS}{monthi}%
3041 {\DTMsrLatnRSimonthname{##2}}%
3042 {\DTMsrLatnRSnoimonthname{##2}}%
3043 }%
3044 {%
3045 \DTMifbool{sr-Latn-RS}{monthi}%
3046 {\DTMsrLatnRSiMonthname{##2}}%
3047 {\DTMsrLatnRSnoiMonthname{##2}}%
3048 }%
3049 \DTMifbool{sr-Latn-RS}{showyear}%
3050 {%
3051 \DTMsrLatnRSmonthyearsep%
3052 % \end{macrocode}
3053 %\changes{2.1.0}{2019-11-22}{%
3054 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3055 % and \cs{DTMDate}. Thanks Nicola!
3056 %}
3057 % \begin{macrocode}
3058 ##1\DTMfinaldot{}%
3059 }%
3060 {}%
3061 }%
3062 }%
3063 {% time style
3064 \renewcommand*\DTMdisplaytime[3]{%
3065 \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
3066 \DTMsrLatnRStimesep\DTMtwodigits{##2}%
3067 \ifDTMshowseconds\DTMsrLatnRStimesep\DTMtwodigits{##3}\fi
3068 }%
3069 }%
3070 {% zone style
3071 \DTMresetzones%
3072 \DTMsrLatnRSzonemaps%
3073 \renewcommand*{\DTMdisplayzone}[2]{%
3074 \DTMifbool{sr-Latn-RS}{mapzone}%
3075 {\DTMusezonemapordefault{##1}{##2}}%
3076 {%
3077 \ifnum##1<0
3078 \else+\fi\DTMtwodigits{##1}%
3079 \ifDTMshowzoneminutes\DTMsrLatnRStimesep\DTMtwodigits{##2}\fi
3080 }%
3081 }%
3082 }%
3083 {% full style
3084 \renewcommand*{\DTMdisplay}[9]{%
3085 \ifDTMshowdate%
3086 \DTMdisplaydate{##1}{##2}{##3}{##4}%
3087 \DTMsrLatnRSdatetimesep%
3088 \fi
3089 \DTMdisplaytime{##5}{##6}{##7}%
3090 \ifDTMshowzone%
3091 \DTMsrLatnRStimezonesep%
3092 \DTMdisplayzone{##8}{##9}%
3093 \fi
3094 }%
3095 \renewcommand*{\DTMDisplay}[9]{%
3096 \ifDTMshowdate%
3097 \DTMDisplaydate{##1}{##2}{##3}{##4}%
3098 \DTMsrLatnRSdatetimesep%
3099 \fi
3100 \DTMdisplaytime{##5}{##6}{##7}%
3101 \ifDTMshowzone%
3102 \DTMsrLatnRStimezonesep%
3103 \DTMdisplayzone{##8}{##9}%
3104 \fi
3105 }%
3106 }%
3107 % \end{macrocode}
3108 %
3109 %
3110 %\begin{macro}{\DTMsrLatnRSmonthordinal}
3111 % Define the month ordinal format to be used by this style.
3112 % \begin{macrocode}
3113 \newcommand*{\DTMsrLatnRSmonthordinal}[1]{%
3114 \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
3115 % \end{macrocode}
3116 %\end{macro}
3117 %\changes{2.0.0}{2019-11-07}{%
3118 % Added a switch between multiple numeric month ordinal formats used in
3119 % Serbian.
3120 %}
3121 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3122 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3123 % Define a setting to switch between Arabic, uppercase Roman and lowercase
3124 % smallcaps Roman month format for the "srLatnRS-numeric" style.
3125 % \begin{macrocode}
3126 \DTMdefchoicekey{sr-Latn-RS}{monthord}%
3127 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
3128 \ifcase\@dtm@nr\relax
3129 \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
3130 \DTMifbool{sr-Latn-RS}{leadingzero}%
3131 {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnRSdatesep}%
3132 \or%
3133 \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
3134 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
3135 {serbianordinalROMAN{##1}}}%
3136 \or%
3137 \renewcommand*{\DTMsrLatnRSmonthordinal}[1]{%
3138 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
3139 {serbianordinalROMAN{##1}}}%
3140 \fi
3141 }
3142 % \end{macrocode}
3143 %\changes{2.0.0}{2019-11-07}{%
3144 % Fixed the (previously entirely wrong) numeric date style.
3145 %}
3146 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3147 %\changes{2.0.0}{2019-11-07}{%
3148 % Added weekday names.
3149 %}
3150 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3151 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3152 % Define numeric style.
3153 % \begin{macrocode}
3154 \DTMnewstyle%
3155 {sr-Latn-RS-numeric}% label
3156 {% date style
3157 \renewcommand*\DTMdisplaydate[4]{%
3158 \ifDTMshowdow%
3159 \ifnum##4>-1
3160 \DTMsrLatnRSweekdayname{##4}%
3161 \DTMsrLatnRSdowdaysep%
3162 \fi
3163 \fi
3164 \DTMifbool{sr-Latn-RS}{showdayofmonth}%
3165 {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
3166 {}%
3167 \DTMsrLatnRSmonthordinal{##2}%
3168 \DTMifbool{sr-Latn-RS}{showyear}%
3169 {%
3170 \DTMsrLatnRSmonthyearsep%
3171 % \end{macrocode}
3172 %\changes{2.1.0}{2019-11-22}{%
3173 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3174 % and \cs{DTMDate}. Thanks Nicola!
3175 %}
3176 % \begin{macrocode}
3177 ##1\DTMfinaldot{}%
3178 }%
3179 {}%
3180 }%
3181 \renewcommand*\DTMDisplaydate[4]{%
3182 \ifDTMshowdow%
3183 \ifnum##4>-1
3184 \DTMsrLatnRSWeekdayname{##4}%
3185 \DTMsrLatnRSdowdaysep%
3186 \fi
3187 \fi
3188 \DTMifbool{sr-Latn-RS}{showdayofmonth}%
3189 {\DTMsrLatnRSdayordinal{##3}\DTMsrLatnRSdaymonthsep}%
3190 {}%
3191 \DTMsrLatnRSmonthordinal{##2}%
3192 \DTMifbool{sr-Latn-RS}{showyear}%
3193 {%
3194 \DTMsrLatnRSmonthyearsep%
3195 % \end{macrocode}
3196 %\changes{2.1.0}{2019-11-22}{%
3197 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3198 % and \cs{DTMDate}. Thanks Nicola!
3199 %}
3200 % \begin{macrocode}
3201 ##1\DTMfinaldot{}%
3202 }%
3203 {}%
3204 }%
3205 }%
3206 {% time style
3207 \renewcommand*\DTMdisplaytime[3]{%
3208 \DTMifbool{sr-Latn-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
3209 \DTMsrLatnRStimesep\DTMtwodigits{##2}%
3210 \ifDTMshowseconds\DTMsrLatnRStimesep\DTMtwodigits{##3}\fi
3211 }%
3212 }%
3213 {% zone style
3214 \DTMresetzones%
3215 \DTMsrLatnRSzonemaps%
3216 \renewcommand*{\DTMdisplayzone}[2]{%
3217 \DTMifbool{sr-Latn-RS}{mapzone}%
3218 {\DTMusezonemapordefault{##1}{##2}}%
3219 {%
3220 \ifnum##1<0
3221 \else+\fi\DTMtwodigits{##1}%
3222 \ifDTMshowzoneminutes\DTMsrLatnRStimesep\DTMtwodigits{##2}\fi
3223 }%
3224 }%
3225 }%
3226 {% full style
3227 \renewcommand*{\DTMdisplay}[9]{%
3228 \ifDTMshowdate%
3229 \DTMdisplaydate{##1}{##2}{##3}{##4}%
3230 \DTMsrLatnRSdatetimesep%
3231 \fi
3232 \DTMdisplaytime{##5}{##6}{##7}%
3233 \ifDTMshowzone%
3234 \DTMsrLatnRStimezonesep%
3235 \DTMdisplayzone{##8}{##9}%
3236 \fi
3237 }%
3238 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
3239 }
3240 % \end{macrocode}
3241 %
3242 %\begin{macro}{\DTMsr-Latn-RSzonemaps}
3243 % The time zone mappings are set through this command, which can be
3244 % redefined if extra mappings are required or mappings need to be
3245 % removed.
3246 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
3247 % \begin{macrocode}
3248 \newcommand*{\DTMsrLatnRSzonemaps}{%
3249 \DTMdefzonemap{01}{00}{CET}%
3250 \DTMdefzonemap{02}{00}{CEST}%
3251 }
3252 % \end{macrocode}
3253 %\end{macro}
3254 % Switch style according to the \opt{useregional} setting.
3255 % \begin{macrocode}
3256 \DTMifcaseregional%
3257 {}% do nothing
3258 {\DTMsetstyle{sr-Latn-RS}}%
3259 {\DTMsetstyle{sr-Latn-RS-numeric}}%
3260 % \end{macrocode}
3261 % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent
3262 % \sty{babel} from resetting \cs{today}. (For this to work,
3263 % \sty{babel} must already have been loaded if it's required.)
3264 %\changes{1.1}{2019-09-14}{removed spurious space}
3265 %\changes{2.0.0}{2019-11-07}{%
3266 % Added regions.
3267 %}
3268 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3269 % \begin{macrocode}
3270 \ifcsundef{date\CurrentTrackedDialect}
3271 {%
3272 \ifundef\dateserbian%
3273 {% do nothing
3274 }%
3275 {%
3276 \def\dateserbian{%
3277 \DTMifcaseregional%
3278 {}% do nothing
3279 {\DTMsetstyle{sr-Latn-RS}}%
3280 {\DTMsetstyle{sr-Latn-RS-numeric}}%
3281 }%
3282 }%
3283 }%
3284 {%
3285 \csdef{date\CurrentTrackedDialect}{%
3286 \DTMifcaseregional%
3287 {}% do nothing
3288 % \end{macrocode}
3289 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
3290 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
3291 % \begin{macrocode}
3292 {\DTMsetstyle{sr-Latn-RS}}%
3293 {\DTMsetstyle{sr-Latn-RS-numeric}}%
3294 }%
3295 }%
3296 % \end{macrocode}
3297 %
3298 %\iffalse
3299 % \begin{macrocode}
3300 %</datetime2-sr-Latn-RS.ldf>
3301 % \end{macrocode}
3302 %\fi
3303 %
3304 %\iffalse
3305 % \begin{macrocode}
3306 %<*datetime2-sr-Latn-ME.ldf>
3307 % \end{macrocode}
3308 %\fi
3309 %
3310 %\subsection{Serbian \sty{sr-Latn-ME} Code
3311 % (\texttt{datetime2-sr-Latn-ME.ldf})}
3312 %\changes{1.0}{2015-03-24}{Initial release}
3313 %\changes{2.0.0}{2019-11-07}{%
3314 % Added regions, all settings made available to regions so all changes can be
3315 % region-specific.
3316 %}
3317 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3318 % \begin{macrocode}
3319 \ProvidesDateTimeModule{sr-Latn-ME}[2019/11/22 v2.1.0]
3320 % \end{macrocode}
3321 %\changes{2.0.0}{2019-11-07}{%
3322 % All localization strings loaded from base module.
3323 %}
3324 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3325 % Load appropriate regionless Serbian module.
3326 % \begin{macrocode}
3327 \RequireDateTimeModule{serbian}
3328 % \end{macrocode}
3329 %
3330 %
3331 %
3332 %\subsubsection{Defining the \sty{sr-Latn-ME} style}
3333 %
3334 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3335 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
3336 % Allow the user a way of configuring the "sr-Latn-ME" and
3337 % "sr-Latn-ME-numeric" styles by providing macros for various format
3338 % elements.
3339 %
3340 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
3341 % case other date formats are also required.
3342 %
3343 %\begin{macro}{\DTMsrLatnMEdowdaysep}
3344 % The separator between weekday and day.
3345 % \begin{macrocode}
3346 \newcommand*{\DTMsrLatnMEdowdaysep}{,\space}
3347 % \end{macrocode}
3348 %\end{macro}
3349 %
3350 %
3351 %\begin{macro}{\DTMsrLatnMEdaymonthsep}
3352 % The separator between the day and month for the text format.
3353 % \begin{macrocode}
3354 \newcommand*{\DTMsrLatnMEdaymonthsep}{%
3355 \DTMtexorpdfstring{\protect~}{\space}%
3356 }
3357 % \end{macrocode}
3358 %\end{macro}
3359 %
3360 %\begin{macro}{\DTMsrLatnMEmonthyearsep}
3361 % The separator between the month and year for the text format.
3362 % \begin{macrocode}
3363 \newcommand*{\DTMsrLatnMEmonthyearsep}{\space}
3364 % \end{macrocode}
3365 %\end{macro}
3366 %
3367 %\begin{macro}{\DTMsrLatnMEdatetimesep}
3368 % The separator between the date and time blocks in the full format (either
3369 % text or numeric).
3370 % \begin{macrocode}
3371 \newcommand*{\DTMsrLatnMEdatetimesep}{\space}
3372 % \end{macrocode}
3373 %\end{macro}
3374 %
3375 %\begin{macro}{\DTMsrLatnMEtimezonesep}
3376 % The separator between the time and zone blocks in the full format (either
3377 % text or numeric).
3378 % \begin{macrocode}
3379 \newcommand*{\DTMsrLatnMEtimezonesep}{\space}
3380 % \end{macrocode}
3381 %\end{macro}
3382 %
3383 %\begin{macro}{\DTMsrLatnMEdatesep}
3384 % The separator for the numeric date format.
3385 % \begin{macrocode}
3386 \newcommand*{\DTMsrLatnMEdatesep}{.}
3387 % \end{macrocode}
3388 %\end{macro}
3389 %
3390 %\begin{macro}{\DTMsrLatnMEtimesep}
3391 % The separator for the numeric time format.
3392 % \begin{macrocode}
3393 \newcommand*{\DTMsrLatnMEtimesep}{.}
3394 % \end{macrocode}
3395 %\end{macro}
3396 %
3397 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
3398 % \begin{macrocode}
3399 \DTMdefkey{sr-Latn-ME}{dowdaysep}%
3400 {\renewcommand*{\DTMsr-Latn-MEdowdaysep}{#1}}
3401 \DTMdefkey{sr-Latn-ME}{daymonthsep}%
3402 {\renewcommand*{\DTMsr-Latn-MEdaymonthsep}{#1}}
3403 \DTMdefkey{sr-Latn-ME}{monthyearsep}%
3404 {\renewcommand*{\DTMsr-Latn-MEmonthyearsep}{#1}}
3405 \DTMdefkey{sr-Latn-ME}{datetimesep}%
3406 {\renewcommand*{\DTMsr-Latn-MEdatetimesep}{#1}}
3407 \DTMdefkey{sr-Latn-ME}{timezonesep}%
3408 {\renewcommand*{\DTMsr-Latn-MEtimezonesep}{#1}}
3409 \DTMdefkey{sr-Latn-ME}{datesep}%
3410 {\renewcommand*{\DTMsr-Latn-MEdatesep}{#1}}
3411 \DTMdefkey{sr-Latn-ME}{timesep}%
3412 {\renewcommand*{\DTMsr-Latn-MEtimesep}{#1}}
3413 % \end{macrocode}
3414 %
3415 %\subsubsection{Switches and settings}
3416 %
3417 %\changes{2.0.0}{2019-11-07}{%
3418 % Added weekday names.
3419 %}
3420 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3421 %\begin{macro}{\DTMsrLatnMEweekdayname}
3422 % Define the weekday name, lowercase.
3423 % \begin{macrocode}
3424 \newcommand*{\DTMsrLatnMEweekdayname}%
3425 {\DTMserbianlatijweekdayname}
3426 % \end{macrocode}
3427 %\end{macro}
3428
3429 %\begin{macro}{\DTMsrLatnMEweekdayname}
3430 % Define the weekday name, capitalized.
3431 % \begin{macrocode}
3432 \newcommand*{\DTMsrLatnMEWeekdayname}%
3433 {\DTMserbianlatijWeekdayname}
3434 % \end{macrocode}
3435 %\end{macro}
3436 %
3437 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
3438 %\changes{2.0.0}{2019-11-07}{%
3439 % Added a way to switch between Ekavian and Ijekavian pronunciation.
3440 %}
3441 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3442 %
3443 % \begin{macrocode}
3444 \DTMdefchoicekey{sr-Latn-ME}%
3445 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
3446 \ifcase\@dtm@nr\relax
3447 \renewcommand*{\DTMsrLatnMEweekdayname}%
3448 {\DTMserbianlatekweekdayname}%
3449 \renewcommand*{\DTMsrLatnMEWeekdayname}%
3450 {\DTMserbianlatekWeekdayname}%
3451 \or%
3452 \renewcommand*{\DTMsrLatnMEweekdayname}%
3453 {\DTMserbianlatijweekdayname}%
3454 \renewcommand*{\DTMsrLatnMEWeekdayname}
3455 {\DTMserbianlatijWeekdayname}%
3456 \fi
3457 }
3458 % \end{macrocode}
3459 %\changes{2.0.0}{2019-11-07}{%
3460 % Added a way to switch June, July alternate spellings.
3461 %}
3462 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3463 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3464 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
3465 % month spellings.
3466 % \begin{macrocode}
3467 \DTMdefboolkey{sr-Latn-ME}{monthi}[true]{}
3468 % \end{macrocode}
3469 % The default is without the "i" suffix.
3470 % \begin{macrocode}
3471 \DTMsetbool{sr-Latn-ME}{monthi}{false}
3472 % \end{macrocode}
3473 %\changes{2.0.0}{2019-11-07}{%
3474 % Added a switch for adding leading zeroes in day and month ordinals.
3475 %}
3476 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3477 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3478 % Define a boolean key that determines if the day and month ordinals should
3479 % have leading zeroes.
3480 % \begin{macrocode}
3481 \DTMdefboolkey{sr-Latn-ME}{leadingzero}[true]{}
3482 % \end{macrocode}
3483 % The default is to omit the leading zero.
3484 % \begin{macrocode}
3485 \DTMsetbool{sr-Latn-ME}{leadingzero}{false}
3486 % \end{macrocode}
3487 %
3488 %\begin{macro}{\DTMsrLatnMEdayordinal}
3489 % Define the day ordinal format to be used by this style.
3490 % \begin{macrocode}
3491 \newcommand*{\DTMsrLatnMEdayordinal}[1]{%
3492 \DTMifbool{sr-Latn-ME}{leadingzero}%
3493 {\DTMtwodigits{#1}}%
3494 {\number#1}\DTMsrLatnMEdatesep}%
3495 % \end{macrocode}
3496 %\end{macro}
3497 %
3498 %\changes{2.1.0}{2019-11-22}{%
3499 % Removed year ordinal macro since year ordinals are handled differently now.
3500 %}
3501 %\changes{2.0.0}{2019-11-07}{%
3502 % Removed the option to switch between writing systems, since that is
3503 % accomplished by using different regions or regionless styles ("serbian" and
3504 % "serbianc" for example).
3505 %}
3506 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3507 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3508 % Define the month names.
3509 %
3510 %\begin{macro}{\DTMsrLatnMEnoimonthname}
3511 % \begin{macrocode}
3512 \newcommand*{\DTMsrLatnMEnoimonthname}{\DTMserbianlatnoimonthname}
3513 % \end{macrocode}
3514 %\end{macro}
3515 %
3516 %\begin{macro}{\DTMsrLatnMEnoiMonthname}
3517 % \begin{macrocode}
3518 \newcommand*{\DTMsrLatnMEnoiMonthname}{\DTMserbianlatnoiMonthname}
3519 % \end{macrocode}
3520 %\end{macro}
3521 %
3522 %\begin{macro}{\DTMsrLatnMEimonthname}
3523 % \begin{macrocode}
3524 \newcommand*{\DTMsrLatnMEimonthname}{\DTMserbianlatimonthname}
3525 % \end{macrocode}
3526 %\end{macro}
3527 %
3528 %\begin{macro}{\DTMsrLatnMEiMonthname}
3529 % \begin{macrocode}
3530 \newcommand*{\DTMsrLatnMEiMonthname}{\DTMserbianlatiMonthname}
3531 % \end{macrocode}
3532 %\end{macro}
3533 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3534 % Define a boolean key that determines if the time zone mappings
3535 % should be used.
3536 % \begin{macrocode}
3537 \DTMdefboolkey{sr-Latn-ME}{mapzone}[true]{}
3538 % \end{macrocode}
3539 % The default is to use mappings.
3540 % \begin{macrocode}
3541 \DTMsetbool{sr-Latn-ME}{mapzone}{true}
3542 % \end{macrocode}
3543 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3544 % Define a boolean key that determines if the day of month should be
3545 % displayed.
3546 % \begin{macrocode}
3547 \DTMdefboolkey{sr-Latn-ME}{showdayofmonth}[true]{}
3548 % \end{macrocode}
3549 % The default is to show the day of month.
3550 % \begin{macrocode}
3551 \DTMsetbool{sr-Latn-ME}{showdayofmonth}{true}
3552 % \end{macrocode}
3553 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3554 % Define a boolean key that determines if the year should be
3555 % displayed.
3556 % \begin{macrocode}
3557 \DTMdefboolkey{sr-Latn-ME}{showyear}[true]{}
3558 % \end{macrocode}
3559 % The default is to show the year.
3560 % \begin{macrocode}
3561 \DTMsetbool{sr-Latn-ME}{showyear}{true}
3562 % \end{macrocode}
3563 %\changes{2.0.0}{2019-11-07}{%
3564 % Added weekday names.
3565 %}
3566 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3567 % \begin{macrocode}
3568 \DTMnewstyle%
3569 {sr-Latn-ME}% label
3570 {% date style
3571 \renewcommand*\DTMdisplaydate[4]{%
3572 \ifDTMshowdow%
3573 \ifnum##4>-1
3574 \DTMsrLatnMEweekdayname{##4}%
3575 \DTMsrLatnMEdowdaysep%
3576 \fi
3577 \fi
3578 \DTMifbool{sr-Latn-ME}{showdayofmonth}
3579 {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
3580 {}%
3581 \DTMifbool{sr-Latn-ME}{monthi}%
3582 {\DTMsrLatnMEimonthname{##2}}%
3583 {\DTMsrLatnMEnoimonthname{##2}}%
3584 \DTMifbool{sr-Latn-ME}{showyear}%
3585 {%
3586 \DTMsrLatnMEmonthyearsep%
3587 % \end{macrocode}
3588 %\changes{2.1.0}{2019-11-22}{%
3589 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3590 % and \cs{DTMDate}. Thanks Nicola!
3591 %}
3592 % \begin{macrocode}
3593 ##1\DTMfinaldot{}%
3594 }%
3595 {}%
3596 }%
3597 \renewcommand*\DTMDisplaydate[4]{%
3598 \ifDTMshowdow%
3599 \ifnum##4>-1
3600 \DTMsrLatnMEWeekdayname{##4}%
3601 \DTMsrLatnMEdowdaysep%
3602 \fi
3603 \fi
3604 \DTMifbool{sr-Latn-ME}{showdayofmonth}
3605 {%
3606 \DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep%
3607 \DTMifbool{sr-Latn-ME}{monthi}%
3608 {\DTMsrLatnMEimonthname{##2}}%
3609 {\DTMsrLatnMEnoimonthname{##2}}%
3610 }%
3611 {%
3612 \DTMifbool{sr-Latn-ME}{monthi}%
3613 {\DTMsrLatnMEiMonthname{##2}}%
3614 {\DTMsrLatnMEnoiMonthname{##2}}%
3615 }%
3616 \DTMifbool{sr-Latn-ME}{showyear}%
3617 {%
3618 \DTMsrLatnMEmonthyearsep%
3619 % \end{macrocode}
3620 %\changes{2.1.0}{2019-11-22}{%
3621 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3622 % and \cs{DTMDate}. Thanks Nicola!
3623 %}
3624 % \begin{macrocode}
3625 ##1\DTMfinaldot{}%
3626 }%
3627 {}%
3628 }%
3629 }%
3630 {% time style
3631 \renewcommand*\DTMdisplaytime[3]{%
3632 \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
3633 \DTMsrLatnMEtimesep\DTMtwodigits{##2}%
3634 \ifDTMshowseconds\DTMsrLatnMEtimesep\DTMtwodigits{##3}\fi
3635 }%
3636 }%
3637 {% zone style
3638 \DTMresetzones%
3639 \DTMsrLatnMEzonemaps%
3640 \renewcommand*{\DTMdisplayzone}[2]{%
3641 \DTMifbool{sr-Latn-ME}{mapzone}%
3642 {\DTMusezonemapordefault{##1}{##2}}%
3643 {%
3644 \ifnum##1<0
3645 \else+\fi\DTMtwodigits{##1}%
3646 \ifDTMshowzoneminutes\DTMsrLatnMEtimesep\DTMtwodigits{##2}\fi
3647 }%
3648 }%
3649 }%
3650 {% full style
3651 \renewcommand*{\DTMdisplay}[9]{%
3652 \ifDTMshowdate%
3653 \DTMdisplaydate{##1}{##2}{##3}{##4}%
3654 \DTMsrLatnMEdatetimesep%
3655 \fi
3656 \DTMdisplaytime{##5}{##6}{##7}%
3657 \ifDTMshowzone%
3658 \DTMsrLatnMEtimezonesep%
3659 \DTMdisplayzone{##8}{##9}%
3660 \fi
3661 }%
3662 \renewcommand*{\DTMDisplay}[9]{%
3663 \ifDTMshowdate%
3664 \DTMDisplaydate{##1}{##2}{##3}{##4}%
3665 \DTMsrLatnMEdatetimesep%
3666 \fi
3667 \DTMdisplaytime{##5}{##6}{##7}%
3668 \ifDTMshowzone%
3669 \DTMsrLatnMEtimezonesep%
3670 \DTMdisplayzone{##8}{##9}%
3671 \fi
3672 }%
3673 }%
3674 % \end{macrocode}
3675 %
3676 %
3677 %\begin{macro}{\DTMsrLatnMEmonthordinal}
3678 % Define the month ordinal format to be used by this style.
3679 % \begin{macrocode}
3680 \newcommand*{\DTMsrLatnMEmonthordinal}[1]{%
3681 \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
3682 % \end{macrocode}
3683 %\end{macro}
3684 %\changes{2.0.0}{2019-11-07}{%
3685 % Added a switch between multiple numeric month ordinal formats used in
3686 % Serbian.
3687 %}
3688 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3689 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3690 % Define a setting to switch between Arabic, uppercase Roman and lowercase
3691 % smallcaps Roman month format for the "srLatnME-numeric" style.
3692 % \begin{macrocode}
3693 \DTMdefchoicekey{sr-Latn-ME}{monthord}%
3694 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
3695 \ifcase\@dtm@nr\relax
3696 \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
3697 \DTMifbool{sr-Latn-ME}{leadingzero}%
3698 {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnMEdatesep}%
3699 \or%
3700 \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
3701 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
3702 {serbianordinalROMAN{##1}}}%
3703 \or%
3704 \renewcommand*{\DTMsrLatnMEmonthordinal}[1]{%
3705 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
3706 {serbianordinalROMAN{##1}}}%
3707 \fi
3708 }
3709 % \end{macrocode}
3710 %\changes{2.0.0}{2019-11-07}{%
3711 % Fixed the (previously entirely wrong) numeric date style.
3712 %}
3713 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3714 %\changes{2.0.0}{2019-11-07}{%
3715 % Added weekday names.
3716 %}
3717 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3718 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
3719 % Define numeric style.
3720 % \begin{macrocode}
3721 \DTMnewstyle%
3722 {sr-Latn-ME-numeric}% label
3723 {% date style
3724 \renewcommand*\DTMdisplaydate[4]{%
3725 \ifDTMshowdow%
3726 \ifnum##4>-1
3727 \DTMsrLatnMEweekdayname{##4}%
3728 \DTMsrLatnMEdowdaysep%
3729 \fi
3730 \fi
3731 \DTMifbool{sr-Latn-ME}{showdayofmonth}%
3732 {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
3733 {}%
3734 \DTMsrLatnMEmonthordinal{##2}%
3735 \DTMifbool{sr-Latn-ME}{showyear}%
3736 {%
3737 \DTMsrLatnMEmonthyearsep%
3738 % \end{macrocode}
3739 %\changes{2.1.0}{2019-11-22}{%
3740 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3741 % and \cs{DTMDate}. Thanks Nicola!
3742 %}
3743 % \begin{macrocode}
3744 ##1\DTMfinaldot{}%
3745 }%
3746 {}%
3747 }%
3748 \renewcommand*\DTMDisplaydate[4]{%
3749 \ifDTMshowdow%
3750 \ifnum##4>-1
3751 \DTMsrLatnMEWeekdayname{##4}%
3752 \DTMsrLatnMEdowdaysep%
3753 \fi
3754 \fi
3755 \DTMifbool{sr-Latn-ME}{showdayofmonth}%
3756 {\DTMsrLatnMEdayordinal{##3}\DTMsrLatnMEdaymonthsep}%
3757 {}%
3758 \DTMsrLatnMEmonthordinal{##2}%
3759 \DTMifbool{sr-Latn-ME}{showyear}%
3760 {%
3761 \DTMsrLatnMEmonthyearsep%
3762 % \end{macrocode}
3763 %\changes{2.1.0}{2019-11-22}{%
3764 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
3765 % and \cs{DTMDate}. Thanks Nicola!
3766 %}
3767 % \begin{macrocode}
3768 ##1\DTMfinaldot{}%
3769 }%
3770 {}%
3771 }%
3772 }%
3773 {% time style
3774 \renewcommand*\DTMdisplaytime[3]{%
3775 \DTMifbool{sr-Latn-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
3776 \DTMsrLatnMEtimesep\DTMtwodigits{##2}%
3777 \ifDTMshowseconds\DTMsrLatnMEtimesep\DTMtwodigits{##3}\fi
3778 }%
3779 }%
3780 {% zone style
3781 \DTMresetzones%
3782 \DTMsrLatnMEzonemaps%
3783 \renewcommand*{\DTMdisplayzone}[2]{%
3784 \DTMifbool{sr-Latn-ME}{mapzone}%
3785 {\DTMusezonemapordefault{##1}{##2}}%
3786 {%
3787 \ifnum##1<0
3788 \else+\fi\DTMtwodigits{##1}%
3789 \ifDTMshowzoneminutes\DTMsrLatnMEtimesep\DTMtwodigits{##2}\fi
3790 }%
3791 }%
3792 }%
3793 {% full style
3794 \renewcommand*{\DTMdisplay}[9]{%
3795 \ifDTMshowdate%
3796 \DTMdisplaydate{##1}{##2}{##3}{##4}%
3797 \DTMsrLatnMEdatetimesep%
3798 \fi
3799 \DTMdisplaytime{##5}{##6}{##7}%
3800 \ifDTMshowzone%
3801 \DTMsrLatnMEtimezonesep%
3802 \DTMdisplayzone{##8}{##9}%
3803 \fi
3804 }%
3805 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
3806 }
3807 % \end{macrocode}
3808 %
3809 %\begin{macro}{\DTMsr-Latn-MEzonemaps}
3810 % The time zone mappings are set through this command, which can be
3811 % redefined if extra mappings are required or mappings need to be
3812 % removed.
3813 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
3814 % \begin{macrocode}
3815 \newcommand*{\DTMsrLatnMEzonemaps}{%
3816 \DTMdefzonemap{01}{00}{CET}%
3817 \DTMdefzonemap{02}{00}{CEST}%
3818 }
3819 % \end{macrocode}
3820 %\end{macro}
3821 % Switch style according to the \opt{useregional} setting.
3822 % \begin{macrocode}
3823 \DTMifcaseregional%
3824 {}% do nothing
3825 {\DTMsetstyle{sr-Latn-ME}}%
3826 {\DTMsetstyle{sr-Latn-ME-numeric}}%
3827 % \end{macrocode}
3828 % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent
3829 % \sty{babel} from resetting \cs{today}. (For this to work,
3830 % \sty{babel} must already have been loaded if it's required.)
3831 %\changes{1.1}{2019-09-14}{removed spurious space}
3832 %\changes{2.0.0}{2019-11-07}{%
3833 % Added regions.
3834 %}
3835 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3836 % \begin{macrocode}
3837 \ifcsundef{date\CurrentTrackedDialect}
3838 {%
3839 \ifundef\dateserbian%
3840 {% do nothing
3841 }%
3842 {%
3843 \def\dateserbian{%
3844 \DTMifcaseregional%
3845 {}% do nothing
3846 {\DTMsetstyle{sr-Latn-ME}}%
3847 {\DTMsetstyle{sr-Latn-ME-numeric}}%
3848 }%
3849 }%
3850 }%
3851 {%
3852 \csdef{date\CurrentTrackedDialect}{%
3853 \DTMifcaseregional%
3854 {}% do nothing
3855 % \end{macrocode}
3856 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
3857 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
3858 % \begin{macrocode}
3859 {\DTMsetstyle{sr-Latn-ME}}%
3860 {\DTMsetstyle{sr-Latn-ME-numeric}}%
3861 }%
3862 }%
3863 % \end{macrocode}
3864 %
3865 %\iffalse
3866 % \begin{macrocode}
3867 %</datetime2-sr-Latn-ME.ldf>
3868 % \end{macrocode}
3869 %\fi
3870 %
3871 %\iffalse
3872 % \begin{macrocode}
3873 %<*datetime2-sr-Latn-BA.ldf>
3874 % \end{macrocode}
3875 %\fi
3876 %
3877 %\subsection{Serbian \sty{sr-Latn-BA} Code
3878 % (\texttt{datetime2-sr-Latn-BA.ldf})}
3879 %\changes{1.0}{2015-03-24}{Initial release}
3880 %\changes{2.0.0}{2019-11-07}{%
3881 % Added regions, all settings made available to regions so all changes can be
3882 % region-specific.
3883 %}
3884 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3885 % \begin{macrocode}
3886 \ProvidesDateTimeModule{sr-Latn-BA}[2019/11/22 v2.1.0]
3887 % \end{macrocode}
3888 %\changes{2.0.0}{2019-11-07}{%
3889 % All localization strings loaded from base module.
3890 %}
3891 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3892 % Load appropriate regionless Serbian module.
3893 % \begin{macrocode}
3894 \RequireDateTimeModule{serbian}
3895 % \end{macrocode}
3896 %
3897 %
3898 %
3899 %\subsubsection{Defining the \sty{sr-Latn-BA} style}
3900 %
3901 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3902 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
3903 % Allow the user a way of configuring the "sr-Latn-BA" and
3904 % "sr-Latn-BA-numeric" styles by providing macros for various format
3905 % elements.
3906 %
3907 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
3908 % case other date formats are also required.
3909 %
3910 %\begin{macro}{\DTMsrLatnBAdowdaysep}
3911 % The separator between weekday and day.
3912 % \begin{macrocode}
3913 \newcommand*{\DTMsrLatnBAdowdaysep}{,\space}
3914 % \end{macrocode}
3915 %\end{macro}
3916 %
3917 %
3918 %\begin{macro}{\DTMsrLatnBAdaymonthsep}
3919 % The separator between the day and month for the text format.
3920 % \begin{macrocode}
3921 \newcommand*{\DTMsrLatnBAdaymonthsep}{%
3922 \DTMtexorpdfstring{\protect~}{\space}%
3923 }
3924 % \end{macrocode}
3925 %\end{macro}
3926 %
3927 %\begin{macro}{\DTMsrLatnBAmonthyearsep}
3928 % The separator between the month and year for the text format.
3929 % \begin{macrocode}
3930 \newcommand*{\DTMsrLatnBAmonthyearsep}{\space}
3931 % \end{macrocode}
3932 %\end{macro}
3933 %
3934 %\begin{macro}{\DTMsrLatnBAdatetimesep}
3935 % The separator between the date and time blocks in the full format (either
3936 % text or numeric).
3937 % \begin{macrocode}
3938 \newcommand*{\DTMsrLatnBAdatetimesep}{\space}
3939 % \end{macrocode}
3940 %\end{macro}
3941 %
3942 %\begin{macro}{\DTMsrLatnBAtimezonesep}
3943 % The separator between the time and zone blocks in the full format (either
3944 % text or numeric).
3945 % \begin{macrocode}
3946 \newcommand*{\DTMsrLatnBAtimezonesep}{\space}
3947 % \end{macrocode}
3948 %\end{macro}
3949 %
3950 %\begin{macro}{\DTMsrLatnBAdatesep}
3951 % The separator for the numeric date format.
3952 % \begin{macrocode}
3953 \newcommand*{\DTMsrLatnBAdatesep}{.}
3954 % \end{macrocode}
3955 %\end{macro}
3956 %
3957 %\begin{macro}{\DTMsrLatnBAtimesep}
3958 % The separator for the numeric time format.
3959 % \begin{macrocode}
3960 \newcommand*{\DTMsrLatnBAtimesep}{.}
3961 % \end{macrocode}
3962 %\end{macro}
3963 %
3964 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
3965 % \begin{macrocode}
3966 \DTMdefkey{sr-Latn-BA}{dowdaysep}%
3967 {\renewcommand*{\DTMsr-Latn-BAdowdaysep}{#1}}
3968 \DTMdefkey{sr-Latn-BA}{daymonthsep}%
3969 {\renewcommand*{\DTMsr-Latn-BAdaymonthsep}{#1}}
3970 \DTMdefkey{sr-Latn-BA}{monthyearsep}%
3971 {\renewcommand*{\DTMsr-Latn-BAmonthyearsep}{#1}}
3972 \DTMdefkey{sr-Latn-BA}{datetimesep}%
3973 {\renewcommand*{\DTMsr-Latn-BAdatetimesep}{#1}}
3974 \DTMdefkey{sr-Latn-BA}{timezonesep}%
3975 {\renewcommand*{\DTMsr-Latn-BAtimezonesep}{#1}}
3976 \DTMdefkey{sr-Latn-BA}{datesep}%
3977 {\renewcommand*{\DTMsr-Latn-BAdatesep}{#1}}
3978 \DTMdefkey{sr-Latn-BA}{timesep}%
3979 {\renewcommand*{\DTMsr-Latn-BAtimesep}{#1}}
3980 % \end{macrocode}
3981 %
3982 %\subsubsection{Switches and settings}
3983 %
3984 %\changes{2.0.0}{2019-11-07}{%
3985 % Added weekday names.
3986 %}
3987 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
3988 %\begin{macro}{\DTMsrLatnBAweekdayname}
3989 % Define the weekday name, lowercase.
3990 % \begin{macrocode}
3991 \newcommand*{\DTMsrLatnBAweekdayname}%
3992 {\DTMserbianlatijweekdayname}
3993 % \end{macrocode}
3994 %\end{macro}
3995
3996 %\begin{macro}{\DTMsrLatnBAweekdayname}
3997 % Define the weekday name, capitalized.
3998 % \begin{macrocode}
3999 \newcommand*{\DTMsrLatnBAWeekdayname}%
4000 {\DTMserbianlatijWeekdayname}
4001 % \end{macrocode}
4002 %\end{macro}
4003 %
4004 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
4005 %\changes{2.0.0}{2019-11-07}{%
4006 % Added a way to switch between Ekavian and Ijekavian pronunciation.
4007 %}
4008 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4009 %
4010 % \begin{macrocode}
4011 \DTMdefchoicekey{sr-Latn-BA}%
4012 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
4013 \ifcase\@dtm@nr\relax
4014 \renewcommand*{\DTMsrLatnBAweekdayname}%
4015 {\DTMserbianlatekweekdayname}%
4016 \renewcommand*{\DTMsrLatnBAWeekdayname}%
4017 {\DTMserbianlatekWeekdayname}%
4018 \or%
4019 \renewcommand*{\DTMsrLatnBAweekdayname}%
4020 {\DTMserbianlatijweekdayname}%
4021 \renewcommand*{\DTMsrLatnBAWeekdayname}
4022 {\DTMserbianlatijWeekdayname}%
4023 \fi
4024 }
4025 % \end{macrocode}
4026 %\changes{2.0.0}{2019-11-07}{%
4027 % Added a way to switch June, July alternate spellings.
4028 %}
4029 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4030 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4031 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
4032 % month spellings.
4033 % \begin{macrocode}
4034 \DTMdefboolkey{sr-Latn-BA}{monthi}[true]{}
4035 % \end{macrocode}
4036 % The default is without the "i" suffix.
4037 % \begin{macrocode}
4038 \DTMsetbool{sr-Latn-BA}{monthi}{false}
4039 % \end{macrocode}
4040 %\changes{2.0.0}{2019-11-07}{%
4041 % Added a switch for adding leading zeroes in day and month ordinals.
4042 %}
4043 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4044 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4045 % Define a boolean key that determines if the day and month ordinals should
4046 % have leading zeroes.
4047 % \begin{macrocode}
4048 \DTMdefboolkey{sr-Latn-BA}{leadingzero}[true]{}
4049 % \end{macrocode}
4050 % The default is to omit the leading zero.
4051 % \begin{macrocode}
4052 \DTMsetbool{sr-Latn-BA}{leadingzero}{false}
4053 % \end{macrocode}
4054 %
4055 %\begin{macro}{\DTMsrLatnBAdayordinal}
4056 % Define the day ordinal format to be used by this style.
4057 % \begin{macrocode}
4058 \newcommand*{\DTMsrLatnBAdayordinal}[1]{%
4059 \DTMifbool{sr-Latn-BA}{leadingzero}%
4060 {\DTMtwodigits{#1}}%
4061 {\number#1}\DTMsrLatnBAdatesep}%
4062 % \end{macrocode}
4063 %\end{macro}
4064 %
4065 %\changes{2.1.0}{2019-11-22}{%
4066 % Removed year ordinal macro since year ordinals are handled differently now.
4067 %}
4068 %\changes{2.0.0}{2019-11-07}{%
4069 % Removed the option to switch between writing systems, since that is
4070 % accomplished by using different regions or regionless styles ("serbian" and
4071 % "serbianc" for example).
4072 %}
4073 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4074 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4075 % Define the month names.
4076 %
4077 %\begin{macro}{\DTMsrLatnBAnoimonthname}
4078 % \begin{macrocode}
4079 \newcommand*{\DTMsrLatnBAnoimonthname}{\DTMserbianlatnoimonthname}
4080 % \end{macrocode}
4081 %\end{macro}
4082 %
4083 %\begin{macro}{\DTMsrLatnBAnoiMonthname}
4084 % \begin{macrocode}
4085 \newcommand*{\DTMsrLatnBAnoiMonthname}{\DTMserbianlatnoiMonthname}
4086 % \end{macrocode}
4087 %\end{macro}
4088 %
4089 %\begin{macro}{\DTMsrLatnBAimonthname}
4090 % \begin{macrocode}
4091 \newcommand*{\DTMsrLatnBAimonthname}{\DTMserbianlatimonthname}
4092 % \end{macrocode}
4093 %\end{macro}
4094 %
4095 %\begin{macro}{\DTMsrLatnBAiMonthname}
4096 % \begin{macrocode}
4097 \newcommand*{\DTMsrLatnBAiMonthname}{\DTMserbianlatiMonthname}
4098 % \end{macrocode}
4099 %\end{macro}
4100 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4101 % Define a boolean key that determines if the time zone mappings
4102 % should be used.
4103 % \begin{macrocode}
4104 \DTMdefboolkey{sr-Latn-BA}{mapzone}[true]{}
4105 % \end{macrocode}
4106 % The default is to use mappings.
4107 % \begin{macrocode}
4108 \DTMsetbool{sr-Latn-BA}{mapzone}{true}
4109 % \end{macrocode}
4110 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4111 % Define a boolean key that determines if the day of month should be
4112 % displayed.
4113 % \begin{macrocode}
4114 \DTMdefboolkey{sr-Latn-BA}{showdayofmonth}[true]{}
4115 % \end{macrocode}
4116 % The default is to show the day of month.
4117 % \begin{macrocode}
4118 \DTMsetbool{sr-Latn-BA}{showdayofmonth}{true}
4119 % \end{macrocode}
4120 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4121 % Define a boolean key that determines if the year should be
4122 % displayed.
4123 % \begin{macrocode}
4124 \DTMdefboolkey{sr-Latn-BA}{showyear}[true]{}
4125 % \end{macrocode}
4126 % The default is to show the year.
4127 % \begin{macrocode}
4128 \DTMsetbool{sr-Latn-BA}{showyear}{true}
4129 % \end{macrocode}
4130 %\changes{2.0.0}{2019-11-07}{%
4131 % Added weekday names.
4132 %}
4133 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4134 % \begin{macrocode}
4135 \DTMnewstyle%
4136 {sr-Latn-BA}% label
4137 {% date style
4138 \renewcommand*\DTMdisplaydate[4]{%
4139 \ifDTMshowdow%
4140 \ifnum##4>-1
4141 \DTMsrLatnBAweekdayname{##4}%
4142 \DTMsrLatnBAdowdaysep%
4143 \fi
4144 \fi
4145 \DTMifbool{sr-Latn-BA}{showdayofmonth}
4146 {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
4147 {}%
4148 \DTMifbool{sr-Latn-BA}{monthi}%
4149 {\DTMsrLatnBAimonthname{##2}}%
4150 {\DTMsrLatnBAnoimonthname{##2}}%
4151 \DTMifbool{sr-Latn-BA}{showyear}%
4152 {%
4153 \DTMsrLatnBAmonthyearsep%
4154 % \end{macrocode}
4155 %\changes{2.1.0}{2019-11-22}{%
4156 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4157 % and \cs{DTMDate}. Thanks Nicola!
4158 %}
4159 % \begin{macrocode}
4160 ##1\DTMfinaldot{}%
4161 }%
4162 {}%
4163 }%
4164 \renewcommand*\DTMDisplaydate[4]{%
4165 \ifDTMshowdow%
4166 \ifnum##4>-1
4167 \DTMsrLatnBAWeekdayname{##4}%
4168 \DTMsrLatnBAdowdaysep%
4169 \fi
4170 \fi
4171 \DTMifbool{sr-Latn-BA}{showdayofmonth}
4172 {%
4173 \DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep%
4174 \DTMifbool{sr-Latn-BA}{monthi}%
4175 {\DTMsrLatnBAimonthname{##2}}%
4176 {\DTMsrLatnBAnoimonthname{##2}}%
4177 }%
4178 {%
4179 \DTMifbool{sr-Latn-BA}{monthi}%
4180 {\DTMsrLatnBAiMonthname{##2}}%
4181 {\DTMsrLatnBAnoiMonthname{##2}}%
4182 }%
4183 \DTMifbool{sr-Latn-BA}{showyear}%
4184 {%
4185 \DTMsrLatnBAmonthyearsep%
4186 % \end{macrocode}
4187 %\changes{2.1.0}{2019-11-22}{%
4188 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4189 % and \cs{DTMDate}. Thanks Nicola!
4190 %}
4191 % \begin{macrocode}
4192 ##1\DTMfinaldot{}%
4193 }%
4194 {}%
4195 }%
4196 }%
4197 {% time style
4198 \renewcommand*\DTMdisplaytime[3]{%
4199 \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
4200 \DTMsrLatnBAtimesep\DTMtwodigits{##2}%
4201 \ifDTMshowseconds\DTMsrLatnBAtimesep\DTMtwodigits{##3}\fi
4202 }%
4203 }%
4204 {% zone style
4205 \DTMresetzones%
4206 \DTMsrLatnBAzonemaps%
4207 \renewcommand*{\DTMdisplayzone}[2]{%
4208 \DTMifbool{sr-Latn-BA}{mapzone}%
4209 {\DTMusezonemapordefault{##1}{##2}}%
4210 {%
4211 \ifnum##1<0
4212 \else+\fi\DTMtwodigits{##1}%
4213 \ifDTMshowzoneminutes\DTMsrLatnBAtimesep\DTMtwodigits{##2}\fi
4214 }%
4215 }%
4216 }%
4217 {% full style
4218 \renewcommand*{\DTMdisplay}[9]{%
4219 \ifDTMshowdate%
4220 \DTMdisplaydate{##1}{##2}{##3}{##4}%
4221 \DTMsrLatnBAdatetimesep%
4222 \fi
4223 \DTMdisplaytime{##5}{##6}{##7}%
4224 \ifDTMshowzone%
4225 \DTMsrLatnBAtimezonesep%
4226 \DTMdisplayzone{##8}{##9}%
4227 \fi
4228 }%
4229 \renewcommand*{\DTMDisplay}[9]{%
4230 \ifDTMshowdate%
4231 \DTMDisplaydate{##1}{##2}{##3}{##4}%
4232 \DTMsrLatnBAdatetimesep%
4233 \fi
4234 \DTMdisplaytime{##5}{##6}{##7}%
4235 \ifDTMshowzone%
4236 \DTMsrLatnBAtimezonesep%
4237 \DTMdisplayzone{##8}{##9}%
4238 \fi
4239 }%
4240 }%
4241 % \end{macrocode}
4242 %
4243 %
4244 %\begin{macro}{\DTMsrLatnBAmonthordinal}
4245 % Define the month ordinal format to be used by this style.
4246 % \begin{macrocode}
4247 \newcommand*{\DTMsrLatnBAmonthordinal}[1]{%
4248 \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
4249 % \end{macrocode}
4250 %\end{macro}
4251 %\changes{2.0.0}{2019-11-07}{%
4252 % Added a switch between multiple numeric month ordinal formats used in
4253 % Serbian.
4254 %}
4255 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4256 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4257 % Define a setting to switch between Arabic, uppercase Roman and lowercase
4258 % smallcaps Roman month format for the "srLatnBA-numeric" style.
4259 % \begin{macrocode}
4260 \DTMdefchoicekey{sr-Latn-BA}{monthord}%
4261 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
4262 \ifcase\@dtm@nr\relax
4263 \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
4264 \DTMifbool{sr-Latn-BA}{leadingzero}%
4265 {\DTMtwodigits{##1}}{\number##1}\DTMsrLatnBAdatesep}%
4266 \or%
4267 \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
4268 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
4269 {serbianordinalROMAN{##1}}}%
4270 \or%
4271 \renewcommand*{\DTMsrLatnBAmonthordinal}[1]{%
4272 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
4273 {serbianordinalROMAN{##1}}}%
4274 \fi
4275 }
4276 % \end{macrocode}
4277 %\changes{2.0.0}{2019-11-07}{%
4278 % Fixed the (previously entirely wrong) numeric date style.
4279 %}
4280 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4281 %\changes{2.0.0}{2019-11-07}{%
4282 % Added weekday names.
4283 %}
4284 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4285 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4286 % Define numeric style.
4287 % \begin{macrocode}
4288 \DTMnewstyle%
4289 {sr-Latn-BA-numeric}% label
4290 {% date style
4291 \renewcommand*\DTMdisplaydate[4]{%
4292 \ifDTMshowdow%
4293 \ifnum##4>-1
4294 \DTMsrLatnBAweekdayname{##4}%
4295 \DTMsrLatnBAdowdaysep%
4296 \fi
4297 \fi
4298 \DTMifbool{sr-Latn-BA}{showdayofmonth}%
4299 {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
4300 {}%
4301 \DTMsrLatnBAmonthordinal{##2}%
4302 \DTMifbool{sr-Latn-BA}{showyear}%
4303 {%
4304 \DTMsrLatnBAmonthyearsep%
4305 % \end{macrocode}
4306 %\changes{2.1.0}{2019-11-22}{%
4307 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4308 % and \cs{DTMDate}. Thanks Nicola!
4309 %}
4310 % \begin{macrocode}
4311 ##1\DTMfinaldot{}%
4312 }%
4313 {}%
4314 }%
4315 \renewcommand*\DTMDisplaydate[4]{%
4316 \ifDTMshowdow%
4317 \ifnum##4>-1
4318 \DTMsrLatnBAWeekdayname{##4}%
4319 \DTMsrLatnBAdowdaysep%
4320 \fi
4321 \fi
4322 \DTMifbool{sr-Latn-BA}{showdayofmonth}%
4323 {\DTMsrLatnBAdayordinal{##3}\DTMsrLatnBAdaymonthsep}%
4324 {}%
4325 \DTMsrLatnBAmonthordinal{##2}%
4326 \DTMifbool{sr-Latn-BA}{showyear}%
4327 {%
4328 \DTMsrLatnBAmonthyearsep%
4329 % \end{macrocode}
4330 %\changes{2.1.0}{2019-11-22}{%
4331 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4332 % and \cs{DTMDate}. Thanks Nicola!
4333 %}
4334 % \begin{macrocode}
4335 ##1\DTMfinaldot{}%
4336 }%
4337 {}%
4338 }%
4339 }%
4340 {% time style
4341 \renewcommand*\DTMdisplaytime[3]{%
4342 \DTMifbool{sr-Latn-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
4343 \DTMsrLatnBAtimesep\DTMtwodigits{##2}%
4344 \ifDTMshowseconds\DTMsrLatnBAtimesep\DTMtwodigits{##3}\fi
4345 }%
4346 }%
4347 {% zone style
4348 \DTMresetzones%
4349 \DTMsrLatnBAzonemaps%
4350 \renewcommand*{\DTMdisplayzone}[2]{%
4351 \DTMifbool{sr-Latn-BA}{mapzone}%
4352 {\DTMusezonemapordefault{##1}{##2}}%
4353 {%
4354 \ifnum##1<0
4355 \else+\fi\DTMtwodigits{##1}%
4356 \ifDTMshowzoneminutes\DTMsrLatnBAtimesep\DTMtwodigits{##2}\fi
4357 }%
4358 }%
4359 }%
4360 {% full style
4361 \renewcommand*{\DTMdisplay}[9]{%
4362 \ifDTMshowdate%
4363 \DTMdisplaydate{##1}{##2}{##3}{##4}%
4364 \DTMsrLatnBAdatetimesep%
4365 \fi
4366 \DTMdisplaytime{##5}{##6}{##7}%
4367 \ifDTMshowzone%
4368 \DTMsrLatnBAtimezonesep%
4369 \DTMdisplayzone{##8}{##9}%
4370 \fi
4371 }%
4372 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
4373 }
4374 % \end{macrocode}
4375 %
4376 %\begin{macro}{\DTMsr-Latn-BAzonemaps}
4377 % The time zone mappings are set through this command, which can be
4378 % redefined if extra mappings are required or mappings need to be
4379 % removed.
4380 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
4381 % \begin{macrocode}
4382 \newcommand*{\DTMsrLatnBAzonemaps}{%
4383 \DTMdefzonemap{01}{00}{CET}%
4384 \DTMdefzonemap{02}{00}{CEST}%
4385 }
4386 % \end{macrocode}
4387 %\end{macro}
4388 % Switch style according to the \opt{useregional} setting.
4389 % \begin{macrocode}
4390 \DTMifcaseregional%
4391 {}% do nothing
4392 {\DTMsetstyle{sr-Latn-BA}}%
4393 {\DTMsetstyle{sr-Latn-BA-numeric}}%
4394 % \end{macrocode}
4395 % Redefine \cs{dateserbian} (or \cs{date}\meta{dialect}) to prevent
4396 % \sty{babel} from resetting \cs{today}. (For this to work,
4397 % \sty{babel} must already have been loaded if it's required.)
4398 %\changes{1.1}{2019-09-14}{removed spurious space}
4399 %\changes{2.0.0}{2019-11-07}{%
4400 % Added regions.
4401 %}
4402 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4403 % \begin{macrocode}
4404 \ifcsundef{date\CurrentTrackedDialect}
4405 {%
4406 \ifundef\dateserbian%
4407 {% do nothing
4408 }%
4409 {%
4410 \def\dateserbian{%
4411 \DTMifcaseregional%
4412 {}% do nothing
4413 {\DTMsetstyle{sr-Latn-BA}}%
4414 {\DTMsetstyle{sr-Latn-BA-numeric}}%
4415 }%
4416 }%
4417 }%
4418 {%
4419 \csdef{date\CurrentTrackedDialect}{%
4420 \DTMifcaseregional%
4421 {}% do nothing
4422 % \end{macrocode}
4423 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
4424 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
4425 % \begin{macrocode}
4426 {\DTMsetstyle{sr-Latn-BA}}%
4427 {\DTMsetstyle{sr-Latn-BA-numeric}}%
4428 }%
4429 }%
4430 % \end{macrocode}
4431 %
4432 %\iffalse
4433 % \begin{macrocode}
4434 %</datetime2-sr-Latn-BA.ldf>
4435 % \end{macrocode}
4436 %\fi
4437 %
4438 %\iffalse
4439 % \begin{macrocode}
4440 %<*datetime2-serbianc.ldf>
4441 % \end{macrocode}
4442 %\fi
4443 %
4444 %\subsection{Serbian \sty{serbianc} Code
4445 % (\texttt{datetime2-serbianc.ldf})}
4446 %\changes{1.0}{2015-03-24}{Initial release}
4447 %\changes{2.0.0}{2019-11-07}{%
4448 % Added regions, all settings made available to regions so all changes can be
4449 % region-specific.
4450 %}
4451 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4452 % \begin{macrocode}
4453 \ProvidesDateTimeModule{serbianc}[2019/11/22 v2.1.0]
4454 % \end{macrocode}
4455 %\changes{2.0.0}{2019-11-07}{%
4456 % All localization strings loaded from base module.
4457 %}
4458 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4459 % Load base Serbian module.
4460 % \begin{macrocode}
4461 \RequireDateTimeModule{serbian-base}
4462 % \end{macrocode}
4463 %
4464 %
4465 %
4466 %\subsubsection{Defining the \sty{serbianc} style}
4467 %
4468 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4469 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
4470 % Allow the user a way of configuring the "serbianc" and
4471 % "serbianc-numeric" styles by providing macros for various format
4472 % elements.
4473 %
4474 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
4475 % case other date formats are also required.
4476 %
4477 %\begin{macro}{\DTMserbiancdowdaysep}
4478 % The separator between weekday and day.
4479 % \begin{macrocode}
4480 \newcommand*{\DTMserbiancdowdaysep}{,\space}
4481 % \end{macrocode}
4482 %\end{macro}
4483 %
4484 %
4485 %\begin{macro}{\DTMserbiancdaymonthsep}
4486 % The separator between the day and month for the text format.
4487 % \begin{macrocode}
4488 \newcommand*{\DTMserbiancdaymonthsep}{%
4489 \DTMtexorpdfstring{\protect~}{\space}%
4490 }
4491 % \end{macrocode}
4492 %\end{macro}
4493 %
4494 %\begin{macro}{\DTMserbiancmonthyearsep}
4495 % The separator between the month and year for the text format.
4496 % \begin{macrocode}
4497 \newcommand*{\DTMserbiancmonthyearsep}{\space}
4498 % \end{macrocode}
4499 %\end{macro}
4500 %
4501 %\begin{macro}{\DTMserbiancdatetimesep}
4502 % The separator between the date and time blocks in the full format (either
4503 % text or numeric).
4504 % \begin{macrocode}
4505 \newcommand*{\DTMserbiancdatetimesep}{\space}
4506 % \end{macrocode}
4507 %\end{macro}
4508 %
4509 %\begin{macro}{\DTMserbianctimezonesep}
4510 % The separator between the time and zone blocks in the full format (either
4511 % text or numeric).
4512 % \begin{macrocode}
4513 \newcommand*{\DTMserbianctimezonesep}{\space}
4514 % \end{macrocode}
4515 %\end{macro}
4516 %
4517 %\begin{macro}{\DTMserbiancdatesep}
4518 % The separator for the numeric date format.
4519 % \begin{macrocode}
4520 \newcommand*{\DTMserbiancdatesep}{.}
4521 % \end{macrocode}
4522 %\end{macro}
4523 %
4524 %\begin{macro}{\DTMserbianctimesep}
4525 % The separator for the numeric time format.
4526 % \begin{macrocode}
4527 \newcommand*{\DTMserbianctimesep}{.}
4528 % \end{macrocode}
4529 %\end{macro}
4530 %
4531 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
4532 % \begin{macrocode}
4533 \DTMdefkey{serbianc}{dowdaysep}%
4534 {\renewcommand*{\DTMserbiancdowdaysep}{#1}}
4535 \DTMdefkey{serbianc}{daymonthsep}%
4536 {\renewcommand*{\DTMserbiancdaymonthsep}{#1}}
4537 \DTMdefkey{serbianc}{monthyearsep}%
4538 {\renewcommand*{\DTMserbiancmonthyearsep}{#1}}
4539 \DTMdefkey{serbianc}{datetimesep}%
4540 {\renewcommand*{\DTMserbiancdatetimesep}{#1}}
4541 \DTMdefkey{serbianc}{timezonesep}%
4542 {\renewcommand*{\DTMserbianctimezonesep}{#1}}
4543 \DTMdefkey{serbianc}{datesep}%
4544 {\renewcommand*{\DTMserbiancdatesep}{#1}}
4545 \DTMdefkey{serbianc}{timesep}%
4546 {\renewcommand*{\DTMserbianctimesep}{#1}}
4547 % \end{macrocode}
4548 %
4549 %\subsubsection{Switches and settings}
4550 %
4551 %\changes{2.0.0}{2019-11-07}{%
4552 % Added weekday names.
4553 %}
4554 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4555 %\begin{macro}{\DTMserbiancweekdayname}
4556 % Define the weekday name, lowercase.
4557 % \begin{macrocode}
4558 \newcommand*{\DTMserbiancweekdayname}%
4559 {\DTMserbiancyrekweekdayname}
4560 % \end{macrocode}
4561 %\end{macro}
4562
4563 %\begin{macro}{\DTMserbiancweekdayname}
4564 % Define the weekday name, capitalized.
4565 % \begin{macrocode}
4566 \newcommand*{\DTMserbiancWeekdayname}%
4567 {\DTMserbiancyrekWeekdayname}
4568 % \end{macrocode}
4569 %\end{macro}
4570 %
4571 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
4572 %\changes{2.0.0}{2019-11-07}{%
4573 % Added a way to switch between Ekavian and Ijekavian pronunciation.
4574 %}
4575 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4576 %
4577 % \begin{macrocode}
4578 \DTMdefchoicekey{serbianc}%
4579 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
4580 \ifcase\@dtm@nr\relax
4581 \renewcommand*{\DTMserbiancweekdayname}%
4582 {\DTMserbiancyrekweekdayname}%
4583 \renewcommand*{\DTMserbiancWeekdayname}%
4584 {\DTMserbiancyrekWeekdayname}%
4585 \or%
4586 \renewcommand*{\DTMserbiancweekdayname}%
4587 {\DTMserbiancyrijweekdayname}%
4588 \renewcommand*{\DTMserbiancWeekdayname}
4589 {\DTMserbiancyrijWeekdayname}%
4590 \fi
4591 }
4592 % \end{macrocode}
4593 %\changes{2.0.0}{2019-11-07}{%
4594 % Added a way to switch June, July alternate spellings.
4595 %}
4596 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4597 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4598 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
4599 % month spellings.
4600 % \begin{macrocode}
4601 \DTMdefboolkey{serbianc}{monthi}[true]{}
4602 % \end{macrocode}
4603 % The default is without the "i" suffix.
4604 % \begin{macrocode}
4605 \DTMsetbool{serbianc}{monthi}{false}
4606 % \end{macrocode}
4607 %\changes{2.0.0}{2019-11-07}{%
4608 % Added a switch for adding leading zeroes in day and month ordinals.
4609 %}
4610 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4611 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4612 % Define a boolean key that determines if the day and month ordinals should
4613 % have leading zeroes.
4614 % \begin{macrocode}
4615 \DTMdefboolkey{serbianc}{leadingzero}[true]{}
4616 % \end{macrocode}
4617 % The default is to omit the leading zero.
4618 % \begin{macrocode}
4619 \DTMsetbool{serbianc}{leadingzero}{false}
4620 % \end{macrocode}
4621 %
4622 %\begin{macro}{\DTMserbiancdayordinal}
4623 % Define the day ordinal format to be used by this style.
4624 % \begin{macrocode}
4625 \newcommand*{\DTMserbiancdayordinal}[1]{%
4626 \DTMifbool{serbianc}{leadingzero}%
4627 {\DTMtwodigits{#1}}%
4628 {\number#1}\DTMserbiancdatesep}%
4629 % \end{macrocode}
4630 %\end{macro}
4631 %
4632 %\changes{2.1.0}{2019-11-22}{%
4633 % Removed year ordinal macro since year ordinals are handled differently now.
4634 %}
4635 %\changes{2.0.0}{2019-11-07}{%
4636 % Removed the option to switch between writing systems, since that is
4637 % accomplished by using different regions or regionless styles ("serbian" and
4638 % "serbianc" for example).
4639 %}
4640 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4641 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4642 % Define the month names.
4643 %
4644 %\begin{macro}{\DTMserbiancnoimonthname}
4645 % \begin{macrocode}
4646 \newcommand*{\DTMserbiancnoimonthname}{\DTMserbiancyrnoimonthname}
4647 % \end{macrocode}
4648 %\end{macro}
4649 %
4650 %\begin{macro}{\DTMserbiancnoiMonthname}
4651 % \begin{macrocode}
4652 \newcommand*{\DTMserbiancnoiMonthname}{\DTMserbiancyrnoiMonthname}
4653 % \end{macrocode}
4654 %\end{macro}
4655 %
4656 %\begin{macro}{\DTMserbiancimonthname}
4657 % \begin{macrocode}
4658 \newcommand*{\DTMserbiancimonthname}{\DTMserbiancyrimonthname}
4659 % \end{macrocode}
4660 %\end{macro}
4661 %
4662 %\begin{macro}{\DTMserbianciMonthname}
4663 % \begin{macrocode}
4664 \newcommand*{\DTMserbianciMonthname}{\DTMserbiancyriMonthname}
4665 % \end{macrocode}
4666 %\end{macro}
4667 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4668 % Define a boolean key that determines if the time zone mappings
4669 % should be used.
4670 % \begin{macrocode}
4671 \DTMdefboolkey{serbianc}{mapzone}[true]{}
4672 % \end{macrocode}
4673 % The default is to use mappings.
4674 % \begin{macrocode}
4675 \DTMsetbool{serbianc}{mapzone}{true}
4676 % \end{macrocode}
4677 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4678 % Define a boolean key that determines if the day of month should be
4679 % displayed.
4680 % \begin{macrocode}
4681 \DTMdefboolkey{serbianc}{showdayofmonth}[true]{}
4682 % \end{macrocode}
4683 % The default is to show the day of month.
4684 % \begin{macrocode}
4685 \DTMsetbool{serbianc}{showdayofmonth}{true}
4686 % \end{macrocode}
4687 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4688 % Define a boolean key that determines if the year should be
4689 % displayed.
4690 % \begin{macrocode}
4691 \DTMdefboolkey{serbianc}{showyear}[true]{}
4692 % \end{macrocode}
4693 % The default is to show the year.
4694 % \begin{macrocode}
4695 \DTMsetbool{serbianc}{showyear}{true}
4696 % \end{macrocode}
4697 %\changes{2.0.0}{2019-11-07}{%
4698 % Added weekday names.
4699 %}
4700 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4701 % \begin{macrocode}
4702 \DTMnewstyle%
4703 {serbianc}% label
4704 {% date style
4705 \renewcommand*\DTMdisplaydate[4]{%
4706 \ifDTMshowdow%
4707 \ifnum##4>-1
4708 \DTMserbiancweekdayname{##4}%
4709 \DTMserbiancdowdaysep%
4710 \fi
4711 \fi
4712 \DTMifbool{serbianc}{showdayofmonth}
4713 {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
4714 {}%
4715 \DTMifbool{serbianc}{monthi}%
4716 {\DTMserbiancimonthname{##2}}%
4717 {\DTMserbiancnoimonthname{##2}}%
4718 \DTMifbool{serbianc}{showyear}%
4719 {%
4720 \DTMserbiancmonthyearsep%
4721 % \end{macrocode}
4722 %\changes{2.1.0}{2019-11-22}{%
4723 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4724 % and \cs{DTMDate}. Thanks Nicola!
4725 %}
4726 % \begin{macrocode}
4727 ##1\DTMfinaldot{}%
4728 }%
4729 {}%
4730 }%
4731 \renewcommand*\DTMDisplaydate[4]{%
4732 \ifDTMshowdow%
4733 \ifnum##4>-1
4734 \DTMserbiancWeekdayname{##4}%
4735 \DTMserbiancdowdaysep%
4736 \fi
4737 \fi
4738 \DTMifbool{serbianc}{showdayofmonth}
4739 {%
4740 \DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep%
4741 \DTMifbool{serbianc}{monthi}%
4742 {\DTMserbiancimonthname{##2}}%
4743 {\DTMserbiancnoimonthname{##2}}%
4744 }%
4745 {%
4746 \DTMifbool{serbianc}{monthi}%
4747 {\DTMserbianciMonthname{##2}}%
4748 {\DTMserbiancnoiMonthname{##2}}%
4749 }%
4750 \DTMifbool{serbianc}{showyear}%
4751 {%
4752 \DTMserbiancmonthyearsep%
4753 % \end{macrocode}
4754 %\changes{2.1.0}{2019-11-22}{%
4755 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4756 % and \cs{DTMDate}. Thanks Nicola!
4757 %}
4758 % \begin{macrocode}
4759 ##1\DTMfinaldot{}%
4760 }%
4761 {}%
4762 }%
4763 }%
4764 {% time style
4765 \renewcommand*\DTMdisplaytime[3]{%
4766 \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
4767 \DTMserbianctimesep\DTMtwodigits{##2}%
4768 \ifDTMshowseconds\DTMserbianctimesep\DTMtwodigits{##3}\fi
4769 }%
4770 }%
4771 {% zone style
4772 \DTMresetzones%
4773 \DTMserbianczonemaps%
4774 \renewcommand*{\DTMdisplayzone}[2]{%
4775 \DTMifbool{serbianc}{mapzone}%
4776 {\DTMusezonemapordefault{##1}{##2}}%
4777 {%
4778 \ifnum##1<0
4779 \else+\fi\DTMtwodigits{##1}%
4780 \ifDTMshowzoneminutes\DTMserbianctimesep\DTMtwodigits{##2}\fi
4781 }%
4782 }%
4783 }%
4784 {% full style
4785 \renewcommand*{\DTMdisplay}[9]{%
4786 \ifDTMshowdate%
4787 \DTMdisplaydate{##1}{##2}{##3}{##4}%
4788 \DTMserbiancdatetimesep%
4789 \fi
4790 \DTMdisplaytime{##5}{##6}{##7}%
4791 \ifDTMshowzone%
4792 \DTMserbianctimezonesep%
4793 \DTMdisplayzone{##8}{##9}%
4794 \fi
4795 }%
4796 \renewcommand*{\DTMDisplay}[9]{%
4797 \ifDTMshowdate%
4798 \DTMDisplaydate{##1}{##2}{##3}{##4}%
4799 \DTMserbiancdatetimesep%
4800 \fi
4801 \DTMdisplaytime{##5}{##6}{##7}%
4802 \ifDTMshowzone%
4803 \DTMserbianctimezonesep%
4804 \DTMdisplayzone{##8}{##9}%
4805 \fi
4806 }%
4807 }%
4808 % \end{macrocode}
4809 %
4810 %
4811 %\begin{macro}{\DTMserbiancmonthordinal}
4812 % Define the month ordinal format to be used by this style.
4813 % \begin{macrocode}
4814 \newcommand*{\DTMserbiancmonthordinal}[1]{%
4815 \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
4816 % \end{macrocode}
4817 %\end{macro}
4818 %\changes{2.0.0}{2019-11-07}{%
4819 % Added a switch between multiple numeric month ordinal formats used in
4820 % Serbian.
4821 %}
4822 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4823 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4824 % Define a setting to switch between Arabic, uppercase Roman and lowercase
4825 % smallcaps Roman month format for the "serbianc-numeric" style.
4826 % \begin{macrocode}
4827 \DTMdefchoicekey{serbianc}{monthord}%
4828 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
4829 \ifcase\@dtm@nr\relax
4830 \renewcommand*{\DTMserbiancmonthordinal}[1]{%
4831 \DTMifbool{serbianc}{leadingzero}%
4832 {\DTMtwodigits{##1}}{\number##1}\DTMserbiancdatesep}%
4833 \or%
4834 \renewcommand*{\DTMserbiancmonthordinal}[1]{%
4835 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
4836 {serbianordinalROMAN{##1}}}%
4837 \or%
4838 \renewcommand*{\DTMserbiancmonthordinal}[1]{%
4839 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
4840 {serbianordinalROMAN{##1}}}%
4841 \fi
4842 }
4843 % \end{macrocode}
4844 %\changes{2.0.0}{2019-11-07}{%
4845 % Fixed the (previously entirely wrong) numeric date style.
4846 %}
4847 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4848 %\changes{2.0.0}{2019-11-07}{%
4849 % Added weekday names.
4850 %}
4851 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4852 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
4853 % Define numeric style.
4854 % \begin{macrocode}
4855 \DTMnewstyle%
4856 {serbianc-numeric}% label
4857 {% date style
4858 \renewcommand*\DTMdisplaydate[4]{%
4859 \ifDTMshowdow%
4860 \ifnum##4>-1
4861 \DTMserbiancweekdayname{##4}%
4862 \DTMserbiancdowdaysep%
4863 \fi
4864 \fi
4865 \DTMifbool{serbianc}{showdayofmonth}%
4866 {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
4867 {}%
4868 \DTMserbiancmonthordinal{##2}%
4869 \DTMifbool{serbianc}{showyear}%
4870 {%
4871 \DTMserbiancmonthyearsep%
4872 % \end{macrocode}
4873 %\changes{2.1.0}{2019-11-22}{%
4874 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4875 % and \cs{DTMDate}. Thanks Nicola!
4876 %}
4877 % \begin{macrocode}
4878 ##1\DTMfinaldot{}%
4879 }%
4880 {}%
4881 }%
4882 \renewcommand*\DTMDisplaydate[4]{%
4883 \ifDTMshowdow%
4884 \ifnum##4>-1
4885 \DTMserbiancWeekdayname{##4}%
4886 \DTMserbiancdowdaysep%
4887 \fi
4888 \fi
4889 \DTMifbool{serbianc}{showdayofmonth}%
4890 {\DTMserbiancdayordinal{##3}\DTMserbiancdaymonthsep}%
4891 {}%
4892 \DTMserbiancmonthordinal{##2}%
4893 \DTMifbool{serbianc}{showyear}%
4894 {%
4895 \DTMserbiancmonthyearsep%
4896 % \end{macrocode}
4897 %\changes{2.1.0}{2019-11-22}{%
4898 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
4899 % and \cs{DTMDate}. Thanks Nicola!
4900 %}
4901 % \begin{macrocode}
4902 ##1\DTMfinaldot{}%
4903 }%
4904 {}%
4905 }%
4906 }%
4907 {% time style
4908 \renewcommand*\DTMdisplaytime[3]{%
4909 \DTMifbool{serbianc}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
4910 \DTMserbianctimesep\DTMtwodigits{##2}%
4911 \ifDTMshowseconds\DTMserbianctimesep\DTMtwodigits{##3}\fi
4912 }%
4913 }%
4914 {% zone style
4915 \DTMresetzones%
4916 \DTMserbianczonemaps%
4917 \renewcommand*{\DTMdisplayzone}[2]{%
4918 \DTMifbool{serbianc}{mapzone}%
4919 {\DTMusezonemapordefault{##1}{##2}}%
4920 {%
4921 \ifnum##1<0
4922 \else+\fi\DTMtwodigits{##1}%
4923 \ifDTMshowzoneminutes\DTMserbianctimesep\DTMtwodigits{##2}\fi
4924 }%
4925 }%
4926 }%
4927 {% full style
4928 \renewcommand*{\DTMdisplay}[9]{%
4929 \ifDTMshowdate%
4930 \DTMdisplaydate{##1}{##2}{##3}{##4}%
4931 \DTMserbiancdatetimesep%
4932 \fi
4933 \DTMdisplaytime{##5}{##6}{##7}%
4934 \ifDTMshowzone%
4935 \DTMserbianctimezonesep%
4936 \DTMdisplayzone{##8}{##9}%
4937 \fi
4938 }%
4939 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
4940 }
4941 % \end{macrocode}
4942 %
4943 %\begin{macro}{\DTMserbianczonemaps}
4944 % The time zone mappings are set through this command, which can be
4945 % redefined if extra mappings are required or mappings need to be
4946 % removed.
4947 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
4948 % \begin{macrocode}
4949 \newcommand*{\DTMserbianczonemaps}{%
4950 \DTMdefzonemap{01}{00}{CET}%
4951 \DTMdefzonemap{02}{00}{CEST}%
4952 }
4953 % \end{macrocode}
4954 %\end{macro}
4955 % Switch style according to the \opt{useregional} setting.
4956 % \begin{macrocode}
4957 \DTMifcaseregional%
4958 {}% do nothing
4959 {\DTMsetstyle{serbianc}}%
4960 {\DTMsetstyle{serbianc-numeric}}%
4961 % \end{macrocode}
4962 % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent
4963 % \sty{babel} from resetting \cs{today}. (For this to work,
4964 % \sty{babel} must already have been loaded if it's required.)
4965 %\changes{1.1}{2019-09-14}{removed spurious space}
4966 %\changes{2.0.0}{2019-11-07}{%
4967 % Added regions.
4968 %}
4969 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
4970 % \begin{macrocode}
4971 \ifcsundef{date\CurrentTrackedDialect}
4972 {%
4973 \ifundef\dateserbianc%
4974 {% do nothing
4975 }%
4976 {%
4977 \def\dateserbianc{%
4978 \DTMifcaseregional%
4979 {}% do nothing
4980 {\DTMsetstyle{serbianc}}%
4981 {\DTMsetstyle{serbianc-numeric}}%
4982 }%
4983 }%
4984 }%
4985 {%
4986 \csdef{date\CurrentTrackedDialect}{%
4987 \DTMifcaseregional%
4988 {}% do nothing
4989 % \end{macrocode}
4990 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
4991 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
4992 % \begin{macrocode}
4993 {\DTMsetstyle{serbianc}}%
4994 {\DTMsetstyle{serbianc-numeric}}%
4995 }%
4996 }%
4997 % \end{macrocode}
4998 %
4999 %\iffalse
5000 % \begin{macrocode}
5001 %</datetime2-serbianc.ldf>
5002 % \end{macrocode}
5003 %\fi
5004 %
5005 %\iffalse
5006 % \begin{macrocode}
5007 %<*datetime2-sr-Cyrl.ldf>
5008 % \end{macrocode}
5009 %\fi
5010 %
5011 %\subsection{Serbian \sty{sr-Cyrl} Code
5012 % (\texttt{datetime2-sr-Cyrl.ldf})}
5013 %\changes{1.0}{2015-03-24}{Initial release}
5014 %\changes{2.0.0}{2019-11-07}{%
5015 % Added regions, all settings made available to regions so all changes can be
5016 % region-specific.
5017 %}
5018 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5019 % \begin{macrocode}
5020 \ProvidesDateTimeModule{sr-Cyrl}[2019/11/22 v2.1.0]
5021 % \end{macrocode}
5022 %\changes{2.0.0}{2019-11-07}{%
5023 % All localization strings loaded from base module.
5024 %}
5025 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5026 % Load appropriate regionless Serbian module.
5027 % \begin{macrocode}
5028 \RequireDateTimeModule{serbianc}
5029 % \end{macrocode}
5030 %
5031 %
5032 %
5033 %\subsubsection{Defining the \sty{sr-Cyrl} style}
5034 %
5035 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5036 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
5037 % Allow the user a way of configuring the "sr-Cyrl" and
5038 % "sr-Cyrl-numeric" styles by providing macros for various format
5039 % elements.
5040 %
5041 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
5042 % case other date formats are also required.
5043 %
5044 %\begin{macro}{\DTMsrCyrldowdaysep}
5045 % The separator between weekday and day.
5046 % \begin{macrocode}
5047 \newcommand*{\DTMsrCyrldowdaysep}{,\space}
5048 % \end{macrocode}
5049 %\end{macro}
5050 %
5051 %
5052 %\begin{macro}{\DTMsrCyrldaymonthsep}
5053 % The separator between the day and month for the text format.
5054 % \begin{macrocode}
5055 \newcommand*{\DTMsrCyrldaymonthsep}{%
5056 \DTMtexorpdfstring{\protect~}{\space}%
5057 }
5058 % \end{macrocode}
5059 %\end{macro}
5060 %
5061 %\begin{macro}{\DTMsrCyrlmonthyearsep}
5062 % The separator between the month and year for the text format.
5063 % \begin{macrocode}
5064 \newcommand*{\DTMsrCyrlmonthyearsep}{\space}
5065 % \end{macrocode}
5066 %\end{macro}
5067 %
5068 %\begin{macro}{\DTMsrCyrldatetimesep}
5069 % The separator between the date and time blocks in the full format (either
5070 % text or numeric).
5071 % \begin{macrocode}
5072 \newcommand*{\DTMsrCyrldatetimesep}{\space}
5073 % \end{macrocode}
5074 %\end{macro}
5075 %
5076 %\begin{macro}{\DTMsrCyrltimezonesep}
5077 % The separator between the time and zone blocks in the full format (either
5078 % text or numeric).
5079 % \begin{macrocode}
5080 \newcommand*{\DTMsrCyrltimezonesep}{\space}
5081 % \end{macrocode}
5082 %\end{macro}
5083 %
5084 %\begin{macro}{\DTMsrCyrldatesep}
5085 % The separator for the numeric date format.
5086 % \begin{macrocode}
5087 \newcommand*{\DTMsrCyrldatesep}{.}
5088 % \end{macrocode}
5089 %\end{macro}
5090 %
5091 %\begin{macro}{\DTMsrCyrltimesep}
5092 % The separator for the numeric time format.
5093 % \begin{macrocode}
5094 \newcommand*{\DTMsrCyrltimesep}{.}
5095 % \end{macrocode}
5096 %\end{macro}
5097 %
5098 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
5099 % \begin{macrocode}
5100 \DTMdefkey{sr-Cyrl}{dowdaysep}%
5101 {\renewcommand*{\DTMsr-Cyrldowdaysep}{#1}}
5102 \DTMdefkey{sr-Cyrl}{daymonthsep}%
5103 {\renewcommand*{\DTMsr-Cyrldaymonthsep}{#1}}
5104 \DTMdefkey{sr-Cyrl}{monthyearsep}%
5105 {\renewcommand*{\DTMsr-Cyrlmonthyearsep}{#1}}
5106 \DTMdefkey{sr-Cyrl}{datetimesep}%
5107 {\renewcommand*{\DTMsr-Cyrldatetimesep}{#1}}
5108 \DTMdefkey{sr-Cyrl}{timezonesep}%
5109 {\renewcommand*{\DTMsr-Cyrltimezonesep}{#1}}
5110 \DTMdefkey{sr-Cyrl}{datesep}%
5111 {\renewcommand*{\DTMsr-Cyrldatesep}{#1}}
5112 \DTMdefkey{sr-Cyrl}{timesep}%
5113 {\renewcommand*{\DTMsr-Cyrltimesep}{#1}}
5114 % \end{macrocode}
5115 %
5116 %\subsubsection{Switches and settings}
5117 %
5118 %\changes{2.0.0}{2019-11-07}{%
5119 % Added weekday names.
5120 %}
5121 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5122 %\begin{macro}{\DTMsrCyrlweekdayname}
5123 % Define the weekday name, lowercase.
5124 % \begin{macrocode}
5125 \newcommand*{\DTMsrCyrlweekdayname}%
5126 {\DTMserbiancyrekweekdayname}
5127 % \end{macrocode}
5128 %\end{macro}
5129
5130 %\begin{macro}{\DTMsrCyrlweekdayname}
5131 % Define the weekday name, capitalized.
5132 % \begin{macrocode}
5133 \newcommand*{\DTMsrCyrlWeekdayname}%
5134 {\DTMserbiancyrekWeekdayname}
5135 % \end{macrocode}
5136 %\end{macro}
5137 %
5138 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
5139 %\changes{2.0.0}{2019-11-07}{%
5140 % Added a way to switch between Ekavian and Ijekavian pronunciation.
5141 %}
5142 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5143 %
5144 % \begin{macrocode}
5145 \DTMdefchoicekey{sr-Cyrl}%
5146 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
5147 \ifcase\@dtm@nr\relax
5148 \renewcommand*{\DTMsrCyrlweekdayname}%
5149 {\DTMserbiancyrekweekdayname}%
5150 \renewcommand*{\DTMsrCyrlWeekdayname}%
5151 {\DTMserbiancyrekWeekdayname}%
5152 \or%
5153 \renewcommand*{\DTMsrCyrlweekdayname}%
5154 {\DTMserbiancyrijweekdayname}%
5155 \renewcommand*{\DTMsrCyrlWeekdayname}
5156 {\DTMserbiancyrijWeekdayname}%
5157 \fi
5158 }
5159 % \end{macrocode}
5160 %\changes{2.0.0}{2019-11-07}{%
5161 % Added a way to switch June, July alternate spellings.
5162 %}
5163 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5164 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5165 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
5166 % month spellings.
5167 % \begin{macrocode}
5168 \DTMdefboolkey{sr-Cyrl}{monthi}[true]{}
5169 % \end{macrocode}
5170 % The default is without the "i" suffix.
5171 % \begin{macrocode}
5172 \DTMsetbool{sr-Cyrl}{monthi}{false}
5173 % \end{macrocode}
5174 %\changes{2.0.0}{2019-11-07}{%
5175 % Added a switch for adding leading zeroes in day and month ordinals.
5176 %}
5177 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5178 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5179 % Define a boolean key that determines if the day and month ordinals should
5180 % have leading zeroes.
5181 % \begin{macrocode}
5182 \DTMdefboolkey{sr-Cyrl}{leadingzero}[true]{}
5183 % \end{macrocode}
5184 % The default is to omit the leading zero.
5185 % \begin{macrocode}
5186 \DTMsetbool{sr-Cyrl}{leadingzero}{false}
5187 % \end{macrocode}
5188 %
5189 %\begin{macro}{\DTMsrCyrldayordinal}
5190 % Define the day ordinal format to be used by this style.
5191 % \begin{macrocode}
5192 \newcommand*{\DTMsrCyrldayordinal}[1]{%
5193 \DTMifbool{sr-Cyrl}{leadingzero}%
5194 {\DTMtwodigits{#1}}%
5195 {\number#1}\DTMsrCyrldatesep}%
5196 % \end{macrocode}
5197 %\end{macro}
5198 %
5199 %\changes{2.1.0}{2019-11-22}{%
5200 % Removed year ordinal macro since year ordinals are handled differently now.
5201 %}
5202 %\changes{2.0.0}{2019-11-07}{%
5203 % Removed the option to switch between writing systems, since that is
5204 % accomplished by using different regions or regionless styles ("serbian" and
5205 % "serbianc" for example).
5206 %}
5207 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5208 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5209 % Define the month names.
5210 %
5211 %\begin{macro}{\DTMsrCyrlnoimonthname}
5212 % \begin{macrocode}
5213 \newcommand*{\DTMsrCyrlnoimonthname}{\DTMserbiancyrnoimonthname}
5214 % \end{macrocode}
5215 %\end{macro}
5216 %
5217 %\begin{macro}{\DTMsrCyrlnoiMonthname}
5218 % \begin{macrocode}
5219 \newcommand*{\DTMsrCyrlnoiMonthname}{\DTMserbiancyrnoiMonthname}
5220 % \end{macrocode}
5221 %\end{macro}
5222 %
5223 %\begin{macro}{\DTMsrCyrlimonthname}
5224 % \begin{macrocode}
5225 \newcommand*{\DTMsrCyrlimonthname}{\DTMserbiancyrimonthname}
5226 % \end{macrocode}
5227 %\end{macro}
5228 %
5229 %\begin{macro}{\DTMsrCyrliMonthname}
5230 % \begin{macrocode}
5231 \newcommand*{\DTMsrCyrliMonthname}{\DTMserbiancyriMonthname}
5232 % \end{macrocode}
5233 %\end{macro}
5234 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5235 % Define a boolean key that determines if the time zone mappings
5236 % should be used.
5237 % \begin{macrocode}
5238 \DTMdefboolkey{sr-Cyrl}{mapzone}[true]{}
5239 % \end{macrocode}
5240 % The default is to use mappings.
5241 % \begin{macrocode}
5242 \DTMsetbool{sr-Cyrl}{mapzone}{true}
5243 % \end{macrocode}
5244 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5245 % Define a boolean key that determines if the day of month should be
5246 % displayed.
5247 % \begin{macrocode}
5248 \DTMdefboolkey{sr-Cyrl}{showdayofmonth}[true]{}
5249 % \end{macrocode}
5250 % The default is to show the day of month.
5251 % \begin{macrocode}
5252 \DTMsetbool{sr-Cyrl}{showdayofmonth}{true}
5253 % \end{macrocode}
5254 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5255 % Define a boolean key that determines if the year should be
5256 % displayed.
5257 % \begin{macrocode}
5258 \DTMdefboolkey{sr-Cyrl}{showyear}[true]{}
5259 % \end{macrocode}
5260 % The default is to show the year.
5261 % \begin{macrocode}
5262 \DTMsetbool{sr-Cyrl}{showyear}{true}
5263 % \end{macrocode}
5264 %\changes{2.0.0}{2019-11-07}{%
5265 % Added weekday names.
5266 %}
5267 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5268 % \begin{macrocode}
5269 \DTMnewstyle%
5270 {sr-Cyrl}% label
5271 {% date style
5272 \renewcommand*\DTMdisplaydate[4]{%
5273 \ifDTMshowdow%
5274 \ifnum##4>-1
5275 \DTMsrCyrlweekdayname{##4}%
5276 \DTMsrCyrldowdaysep%
5277 \fi
5278 \fi
5279 \DTMifbool{sr-Cyrl}{showdayofmonth}
5280 {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
5281 {}%
5282 \DTMifbool{sr-Cyrl}{monthi}%
5283 {\DTMsrCyrlimonthname{##2}}%
5284 {\DTMsrCyrlnoimonthname{##2}}%
5285 \DTMifbool{sr-Cyrl}{showyear}%
5286 {%
5287 \DTMsrCyrlmonthyearsep%
5288 % \end{macrocode}
5289 %\changes{2.1.0}{2019-11-22}{%
5290 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5291 % and \cs{DTMDate}. Thanks Nicola!
5292 %}
5293 % \begin{macrocode}
5294 ##1\DTMfinaldot{}%
5295 }%
5296 {}%
5297 }%
5298 \renewcommand*\DTMDisplaydate[4]{%
5299 \ifDTMshowdow%
5300 \ifnum##4>-1
5301 \DTMsrCyrlWeekdayname{##4}%
5302 \DTMsrCyrldowdaysep%
5303 \fi
5304 \fi
5305 \DTMifbool{sr-Cyrl}{showdayofmonth}
5306 {%
5307 \DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep%
5308 \DTMifbool{sr-Cyrl}{monthi}%
5309 {\DTMsrCyrlimonthname{##2}}%
5310 {\DTMsrCyrlnoimonthname{##2}}%
5311 }%
5312 {%
5313 \DTMifbool{sr-Cyrl}{monthi}%
5314 {\DTMsrCyrliMonthname{##2}}%
5315 {\DTMsrCyrlnoiMonthname{##2}}%
5316 }%
5317 \DTMifbool{sr-Cyrl}{showyear}%
5318 {%
5319 \DTMsrCyrlmonthyearsep%
5320 % \end{macrocode}
5321 %\changes{2.1.0}{2019-11-22}{%
5322 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5323 % and \cs{DTMDate}. Thanks Nicola!
5324 %}
5325 % \begin{macrocode}
5326 ##1\DTMfinaldot{}%
5327 }%
5328 {}%
5329 }%
5330 }%
5331 {% time style
5332 \renewcommand*\DTMdisplaytime[3]{%
5333 \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
5334 \DTMsrCyrltimesep\DTMtwodigits{##2}%
5335 \ifDTMshowseconds\DTMsrCyrltimesep\DTMtwodigits{##3}\fi
5336 }%
5337 }%
5338 {% zone style
5339 \DTMresetzones%
5340 \DTMsrCyrlzonemaps%
5341 \renewcommand*{\DTMdisplayzone}[2]{%
5342 \DTMifbool{sr-Cyrl}{mapzone}%
5343 {\DTMusezonemapordefault{##1}{##2}}%
5344 {%
5345 \ifnum##1<0
5346 \else+\fi\DTMtwodigits{##1}%
5347 \ifDTMshowzoneminutes\DTMsrCyrltimesep\DTMtwodigits{##2}\fi
5348 }%
5349 }%
5350 }%
5351 {% full style
5352 \renewcommand*{\DTMdisplay}[9]{%
5353 \ifDTMshowdate%
5354 \DTMdisplaydate{##1}{##2}{##3}{##4}%
5355 \DTMsrCyrldatetimesep%
5356 \fi
5357 \DTMdisplaytime{##5}{##6}{##7}%
5358 \ifDTMshowzone%
5359 \DTMsrCyrltimezonesep%
5360 \DTMdisplayzone{##8}{##9}%
5361 \fi
5362 }%
5363 \renewcommand*{\DTMDisplay}[9]{%
5364 \ifDTMshowdate%
5365 \DTMDisplaydate{##1}{##2}{##3}{##4}%
5366 \DTMsrCyrldatetimesep%
5367 \fi
5368 \DTMdisplaytime{##5}{##6}{##7}%
5369 \ifDTMshowzone%
5370 \DTMsrCyrltimezonesep%
5371 \DTMdisplayzone{##8}{##9}%
5372 \fi
5373 }%
5374 }%
5375 % \end{macrocode}
5376 %
5377 %
5378 %\begin{macro}{\DTMsrCyrlmonthordinal}
5379 % Define the month ordinal format to be used by this style.
5380 % \begin{macrocode}
5381 \newcommand*{\DTMsrCyrlmonthordinal}[1]{%
5382 \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
5383 % \end{macrocode}
5384 %\end{macro}
5385 %\changes{2.0.0}{2019-11-07}{%
5386 % Added a switch between multiple numeric month ordinal formats used in
5387 % Serbian.
5388 %}
5389 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5390 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5391 % Define a setting to switch between Arabic, uppercase Roman and lowercase
5392 % smallcaps Roman month format for the "srCyrl-numeric" style.
5393 % \begin{macrocode}
5394 \DTMdefchoicekey{sr-Cyrl}{monthord}%
5395 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
5396 \ifcase\@dtm@nr\relax
5397 \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
5398 \DTMifbool{sr-Cyrl}{leadingzero}%
5399 {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrldatesep}%
5400 \or%
5401 \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
5402 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
5403 {serbianordinalROMAN{##1}}}%
5404 \or%
5405 \renewcommand*{\DTMsrCyrlmonthordinal}[1]{%
5406 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
5407 {serbianordinalROMAN{##1}}}%
5408 \fi
5409 }
5410 % \end{macrocode}
5411 %\changes{2.0.0}{2019-11-07}{%
5412 % Fixed the (previously entirely wrong) numeric date style.
5413 %}
5414 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5415 %\changes{2.0.0}{2019-11-07}{%
5416 % Added weekday names.
5417 %}
5418 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5419 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5420 % Define numeric style.
5421 % \begin{macrocode}
5422 \DTMnewstyle%
5423 {sr-Cyrl-numeric}% label
5424 {% date style
5425 \renewcommand*\DTMdisplaydate[4]{%
5426 \ifDTMshowdow%
5427 \ifnum##4>-1
5428 \DTMsrCyrlweekdayname{##4}%
5429 \DTMsrCyrldowdaysep%
5430 \fi
5431 \fi
5432 \DTMifbool{sr-Cyrl}{showdayofmonth}%
5433 {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
5434 {}%
5435 \DTMsrCyrlmonthordinal{##2}%
5436 \DTMifbool{sr-Cyrl}{showyear}%
5437 {%
5438 \DTMsrCyrlmonthyearsep%
5439 % \end{macrocode}
5440 %\changes{2.1.0}{2019-11-22}{%
5441 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5442 % and \cs{DTMDate}. Thanks Nicola!
5443 %}
5444 % \begin{macrocode}
5445 ##1\DTMfinaldot{}%
5446 }%
5447 {}%
5448 }%
5449 \renewcommand*\DTMDisplaydate[4]{%
5450 \ifDTMshowdow%
5451 \ifnum##4>-1
5452 \DTMsrCyrlWeekdayname{##4}%
5453 \DTMsrCyrldowdaysep%
5454 \fi
5455 \fi
5456 \DTMifbool{sr-Cyrl}{showdayofmonth}%
5457 {\DTMsrCyrldayordinal{##3}\DTMsrCyrldaymonthsep}%
5458 {}%
5459 \DTMsrCyrlmonthordinal{##2}%
5460 \DTMifbool{sr-Cyrl}{showyear}%
5461 {%
5462 \DTMsrCyrlmonthyearsep%
5463 % \end{macrocode}
5464 %\changes{2.1.0}{2019-11-22}{%
5465 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5466 % and \cs{DTMDate}. Thanks Nicola!
5467 %}
5468 % \begin{macrocode}
5469 ##1\DTMfinaldot{}%
5470 }%
5471 {}%
5472 }%
5473 }%
5474 {% time style
5475 \renewcommand*\DTMdisplaytime[3]{%
5476 \DTMifbool{sr-Cyrl}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
5477 \DTMsrCyrltimesep\DTMtwodigits{##2}%
5478 \ifDTMshowseconds\DTMsrCyrltimesep\DTMtwodigits{##3}\fi
5479 }%
5480 }%
5481 {% zone style
5482 \DTMresetzones%
5483 \DTMsrCyrlzonemaps%
5484 \renewcommand*{\DTMdisplayzone}[2]{%
5485 \DTMifbool{sr-Cyrl}{mapzone}%
5486 {\DTMusezonemapordefault{##1}{##2}}%
5487 {%
5488 \ifnum##1<0
5489 \else+\fi\DTMtwodigits{##1}%
5490 \ifDTMshowzoneminutes\DTMsrCyrltimesep\DTMtwodigits{##2}\fi
5491 }%
5492 }%
5493 }%
5494 {% full style
5495 \renewcommand*{\DTMdisplay}[9]{%
5496 \ifDTMshowdate%
5497 \DTMdisplaydate{##1}{##2}{##3}{##4}%
5498 \DTMsrCyrldatetimesep%
5499 \fi
5500 \DTMdisplaytime{##5}{##6}{##7}%
5501 \ifDTMshowzone%
5502 \DTMsrCyrltimezonesep%
5503 \DTMdisplayzone{##8}{##9}%
5504 \fi
5505 }%
5506 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
5507 }
5508 % \end{macrocode}
5509 %
5510 %\begin{macro}{\DTMsr-Cyrlzonemaps}
5511 % The time zone mappings are set through this command, which can be
5512 % redefined if extra mappings are required or mappings need to be
5513 % removed.
5514 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
5515 % \begin{macrocode}
5516 \newcommand*{\DTMsrCyrlzonemaps}{%
5517 \DTMdefzonemap{01}{00}{CET}%
5518 \DTMdefzonemap{02}{00}{CEST}%
5519 }
5520 % \end{macrocode}
5521 %\end{macro}
5522 % Switch style according to the \opt{useregional} setting.
5523 % \begin{macrocode}
5524 \DTMifcaseregional%
5525 {}% do nothing
5526 {\DTMsetstyle{sr-Cyrl}}%
5527 {\DTMsetstyle{sr-Cyrl-numeric}}%
5528 % \end{macrocode}
5529 % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent
5530 % \sty{babel} from resetting \cs{today}. (For this to work,
5531 % \sty{babel} must already have been loaded if it's required.)
5532 %\changes{1.1}{2019-09-14}{removed spurious space}
5533 %\changes{2.0.0}{2019-11-07}{%
5534 % Added regions.
5535 %}
5536 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5537 % \begin{macrocode}
5538 \ifcsundef{date\CurrentTrackedDialect}
5539 {%
5540 \ifundef\dateserbianc%
5541 {% do nothing
5542 }%
5543 {%
5544 \def\dateserbianc{%
5545 \DTMifcaseregional%
5546 {}% do nothing
5547 {\DTMsetstyle{sr-Cyrl}}%
5548 {\DTMsetstyle{sr-Cyrl-numeric}}%
5549 }%
5550 }%
5551 }%
5552 {%
5553 \csdef{date\CurrentTrackedDialect}{%
5554 \DTMifcaseregional%
5555 {}% do nothing
5556 % \end{macrocode}
5557 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
5558 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
5559 % \begin{macrocode}
5560 {\DTMsetstyle{sr-Cyrl}}%
5561 {\DTMsetstyle{sr-Cyrl-numeric}}%
5562 }%
5563 }%
5564 % \end{macrocode}
5565 %
5566 %\iffalse
5567 % \begin{macrocode}
5568 %</datetime2-sr-Cyrl.ldf>
5569 % \end{macrocode}
5570 %\fi
5571 %
5572 %\iffalse
5573 % \begin{macrocode}
5574 %<*datetime2-sr-Cyrl-RS.ldf>
5575 % \end{macrocode}
5576 %\fi
5577 %
5578 %\subsection{Serbian \sty{sr-Cyrl-RS} Code
5579 % (\texttt{datetime2-sr-Cyrl-RS.ldf})}
5580 %\changes{1.0}{2015-03-24}{Initial release}
5581 %\changes{2.0.0}{2019-11-07}{%
5582 % Added regions, all settings made available to regions so all changes can be
5583 % region-specific.
5584 %}
5585 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5586 % \begin{macrocode}
5587 \ProvidesDateTimeModule{sr-Cyrl-RS}[2019/11/22 v2.1.0]
5588 % \end{macrocode}
5589 %\changes{2.0.0}{2019-11-07}{%
5590 % All localization strings loaded from base module.
5591 %}
5592 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5593 % Load appropriate regionless Serbian module.
5594 % \begin{macrocode}
5595 \RequireDateTimeModule{serbianc}
5596 % \end{macrocode}
5597 %
5598 %
5599 %
5600 %\subsubsection{Defining the \sty{sr-Cyrl-RS} style}
5601 %
5602 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5603 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
5604 % Allow the user a way of configuring the "sr-Cyrl-RS" and
5605 % "sr-Cyrl-RS-numeric" styles by providing macros for various format
5606 % elements.
5607 %
5608 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
5609 % case other date formats are also required.
5610 %
5611 %\begin{macro}{\DTMsrCyrlRSdowdaysep}
5612 % The separator between weekday and day.
5613 % \begin{macrocode}
5614 \newcommand*{\DTMsrCyrlRSdowdaysep}{,\space}
5615 % \end{macrocode}
5616 %\end{macro}
5617 %
5618 %
5619 %\begin{macro}{\DTMsrCyrlRSdaymonthsep}
5620 % The separator between the day and month for the text format.
5621 % \begin{macrocode}
5622 \newcommand*{\DTMsrCyrlRSdaymonthsep}{%
5623 \DTMtexorpdfstring{\protect~}{\space}%
5624 }
5625 % \end{macrocode}
5626 %\end{macro}
5627 %
5628 %\begin{macro}{\DTMsrCyrlRSmonthyearsep}
5629 % The separator between the month and year for the text format.
5630 % \begin{macrocode}
5631 \newcommand*{\DTMsrCyrlRSmonthyearsep}{\space}
5632 % \end{macrocode}
5633 %\end{macro}
5634 %
5635 %\begin{macro}{\DTMsrCyrlRSdatetimesep}
5636 % The separator between the date and time blocks in the full format (either
5637 % text or numeric).
5638 % \begin{macrocode}
5639 \newcommand*{\DTMsrCyrlRSdatetimesep}{\space}
5640 % \end{macrocode}
5641 %\end{macro}
5642 %
5643 %\begin{macro}{\DTMsrCyrlRStimezonesep}
5644 % The separator between the time and zone blocks in the full format (either
5645 % text or numeric).
5646 % \begin{macrocode}
5647 \newcommand*{\DTMsrCyrlRStimezonesep}{\space}
5648 % \end{macrocode}
5649 %\end{macro}
5650 %
5651 %\begin{macro}{\DTMsrCyrlRSdatesep}
5652 % The separator for the numeric date format.
5653 % \begin{macrocode}
5654 \newcommand*{\DTMsrCyrlRSdatesep}{.}
5655 % \end{macrocode}
5656 %\end{macro}
5657 %
5658 %\begin{macro}{\DTMsrCyrlRStimesep}
5659 % The separator for the numeric time format.
5660 % \begin{macrocode}
5661 \newcommand*{\DTMsrCyrlRStimesep}{.}
5662 % \end{macrocode}
5663 %\end{macro}
5664 %
5665 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
5666 % \begin{macrocode}
5667 \DTMdefkey{sr-Cyrl-RS}{dowdaysep}%
5668 {\renewcommand*{\DTMsr-Cyrl-RSdowdaysep}{#1}}
5669 \DTMdefkey{sr-Cyrl-RS}{daymonthsep}%
5670 {\renewcommand*{\DTMsr-Cyrl-RSdaymonthsep}{#1}}
5671 \DTMdefkey{sr-Cyrl-RS}{monthyearsep}%
5672 {\renewcommand*{\DTMsr-Cyrl-RSmonthyearsep}{#1}}
5673 \DTMdefkey{sr-Cyrl-RS}{datetimesep}%
5674 {\renewcommand*{\DTMsr-Cyrl-RSdatetimesep}{#1}}
5675 \DTMdefkey{sr-Cyrl-RS}{timezonesep}%
5676 {\renewcommand*{\DTMsr-Cyrl-RStimezonesep}{#1}}
5677 \DTMdefkey{sr-Cyrl-RS}{datesep}%
5678 {\renewcommand*{\DTMsr-Cyrl-RSdatesep}{#1}}
5679 \DTMdefkey{sr-Cyrl-RS}{timesep}%
5680 {\renewcommand*{\DTMsr-Cyrl-RStimesep}{#1}}
5681 % \end{macrocode}
5682 %
5683 %\subsubsection{Switches and settings}
5684 %
5685 %\changes{2.0.0}{2019-11-07}{%
5686 % Added weekday names.
5687 %}
5688 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5689 %\begin{macro}{\DTMsrCyrlRSweekdayname}
5690 % Define the weekday name, lowercase.
5691 % \begin{macrocode}
5692 \newcommand*{\DTMsrCyrlRSweekdayname}%
5693 {\DTMserbiancyrijweekdayname}
5694 % \end{macrocode}
5695 %\end{macro}
5696
5697 %\begin{macro}{\DTMsrCyrlRSweekdayname}
5698 % Define the weekday name, capitalized.
5699 % \begin{macrocode}
5700 \newcommand*{\DTMsrCyrlRSWeekdayname}%
5701 {\DTMserbiancyrijWeekdayname}
5702 % \end{macrocode}
5703 %\end{macro}
5704 %
5705 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
5706 %\changes{2.0.0}{2019-11-07}{%
5707 % Added a way to switch between Ekavian and Ijekavian pronunciation.
5708 %}
5709 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5710 %
5711 % \begin{macrocode}
5712 \DTMdefchoicekey{sr-Cyrl-RS}%
5713 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
5714 \ifcase\@dtm@nr\relax
5715 \renewcommand*{\DTMsrCyrlRSweekdayname}%
5716 {\DTMserbiancyrekweekdayname}%
5717 \renewcommand*{\DTMsrCyrlRSWeekdayname}%
5718 {\DTMserbiancyrekWeekdayname}%
5719 \or%
5720 \renewcommand*{\DTMsrCyrlRSweekdayname}%
5721 {\DTMserbiancyrijweekdayname}%
5722 \renewcommand*{\DTMsrCyrlRSWeekdayname}
5723 {\DTMserbiancyrijWeekdayname}%
5724 \fi
5725 }
5726 % \end{macrocode}
5727 %\changes{2.0.0}{2019-11-07}{%
5728 % Added a way to switch June, July alternate spellings.
5729 %}
5730 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5731 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5732 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
5733 % month spellings.
5734 % \begin{macrocode}
5735 \DTMdefboolkey{sr-Cyrl-RS}{monthi}[true]{}
5736 % \end{macrocode}
5737 % The default is without the "i" suffix.
5738 % \begin{macrocode}
5739 \DTMsetbool{sr-Cyrl-RS}{monthi}{false}
5740 % \end{macrocode}
5741 %\changes{2.0.0}{2019-11-07}{%
5742 % Added a switch for adding leading zeroes in day and month ordinals.
5743 %}
5744 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5745 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5746 % Define a boolean key that determines if the day and month ordinals should
5747 % have leading zeroes.
5748 % \begin{macrocode}
5749 \DTMdefboolkey{sr-Cyrl-RS}{leadingzero}[true]{}
5750 % \end{macrocode}
5751 % The default is to omit the leading zero.
5752 % \begin{macrocode}
5753 \DTMsetbool{sr-Cyrl-RS}{leadingzero}{false}
5754 % \end{macrocode}
5755 %
5756 %\begin{macro}{\DTMsrCyrlRSdayordinal}
5757 % Define the day ordinal format to be used by this style.
5758 % \begin{macrocode}
5759 \newcommand*{\DTMsrCyrlRSdayordinal}[1]{%
5760 \DTMifbool{sr-Cyrl-RS}{leadingzero}%
5761 {\DTMtwodigits{#1}}%
5762 {\number#1}\DTMsrCyrlRSdatesep}%
5763 % \end{macrocode}
5764 %\end{macro}
5765 %
5766 %\changes{2.1.0}{2019-11-22}{%
5767 % Removed year ordinal macro since year ordinals are handled differently now.
5768 %}
5769 %\changes{2.0.0}{2019-11-07}{%
5770 % Removed the option to switch between writing systems, since that is
5771 % accomplished by using different regions or regionless styles ("serbian" and
5772 % "serbianc" for example).
5773 %}
5774 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5775 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5776 % Define the month names.
5777 %
5778 %\begin{macro}{\DTMsrCyrlRSnoimonthname}
5779 % \begin{macrocode}
5780 \newcommand*{\DTMsrCyrlRSnoimonthname}{\DTMserbiancyrnoimonthname}
5781 % \end{macrocode}
5782 %\end{macro}
5783 %
5784 %\begin{macro}{\DTMsrCyrlRSnoiMonthname}
5785 % \begin{macrocode}
5786 \newcommand*{\DTMsrCyrlRSnoiMonthname}{\DTMserbiancyrnoiMonthname}
5787 % \end{macrocode}
5788 %\end{macro}
5789 %
5790 %\begin{macro}{\DTMsrCyrlRSimonthname}
5791 % \begin{macrocode}
5792 \newcommand*{\DTMsrCyrlRSimonthname}{\DTMserbiancyrimonthname}
5793 % \end{macrocode}
5794 %\end{macro}
5795 %
5796 %\begin{macro}{\DTMsrCyrlRSiMonthname}
5797 % \begin{macrocode}
5798 \newcommand*{\DTMsrCyrlRSiMonthname}{\DTMserbiancyriMonthname}
5799 % \end{macrocode}
5800 %\end{macro}
5801 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5802 % Define a boolean key that determines if the time zone mappings
5803 % should be used.
5804 % \begin{macrocode}
5805 \DTMdefboolkey{sr-Cyrl-RS}{mapzone}[true]{}
5806 % \end{macrocode}
5807 % The default is to use mappings.
5808 % \begin{macrocode}
5809 \DTMsetbool{sr-Cyrl-RS}{mapzone}{true}
5810 % \end{macrocode}
5811 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5812 % Define a boolean key that determines if the day of month should be
5813 % displayed.
5814 % \begin{macrocode}
5815 \DTMdefboolkey{sr-Cyrl-RS}{showdayofmonth}[true]{}
5816 % \end{macrocode}
5817 % The default is to show the day of month.
5818 % \begin{macrocode}
5819 \DTMsetbool{sr-Cyrl-RS}{showdayofmonth}{true}
5820 % \end{macrocode}
5821 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5822 % Define a boolean key that determines if the year should be
5823 % displayed.
5824 % \begin{macrocode}
5825 \DTMdefboolkey{sr-Cyrl-RS}{showyear}[true]{}
5826 % \end{macrocode}
5827 % The default is to show the year.
5828 % \begin{macrocode}
5829 \DTMsetbool{sr-Cyrl-RS}{showyear}{true}
5830 % \end{macrocode}
5831 %\changes{2.0.0}{2019-11-07}{%
5832 % Added weekday names.
5833 %}
5834 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5835 % \begin{macrocode}
5836 \DTMnewstyle%
5837 {sr-Cyrl-RS}% label
5838 {% date style
5839 \renewcommand*\DTMdisplaydate[4]{%
5840 \ifDTMshowdow%
5841 \ifnum##4>-1
5842 \DTMsrCyrlRSweekdayname{##4}%
5843 \DTMsrCyrlRSdowdaysep%
5844 \fi
5845 \fi
5846 \DTMifbool{sr-Cyrl-RS}{showdayofmonth}
5847 {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
5848 {}%
5849 \DTMifbool{sr-Cyrl-RS}{monthi}%
5850 {\DTMsrCyrlRSimonthname{##2}}%
5851 {\DTMsrCyrlRSnoimonthname{##2}}%
5852 \DTMifbool{sr-Cyrl-RS}{showyear}%
5853 {%
5854 \DTMsrCyrlRSmonthyearsep%
5855 % \end{macrocode}
5856 %\changes{2.1.0}{2019-11-22}{%
5857 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5858 % and \cs{DTMDate}. Thanks Nicola!
5859 %}
5860 % \begin{macrocode}
5861 ##1\DTMfinaldot{}%
5862 }%
5863 {}%
5864 }%
5865 \renewcommand*\DTMDisplaydate[4]{%
5866 \ifDTMshowdow%
5867 \ifnum##4>-1
5868 \DTMsrCyrlRSWeekdayname{##4}%
5869 \DTMsrCyrlRSdowdaysep%
5870 \fi
5871 \fi
5872 \DTMifbool{sr-Cyrl-RS}{showdayofmonth}
5873 {%
5874 \DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep%
5875 \DTMifbool{sr-Cyrl-RS}{monthi}%
5876 {\DTMsrCyrlRSimonthname{##2}}%
5877 {\DTMsrCyrlRSnoimonthname{##2}}%
5878 }%
5879 {%
5880 \DTMifbool{sr-Cyrl-RS}{monthi}%
5881 {\DTMsrCyrlRSiMonthname{##2}}%
5882 {\DTMsrCyrlRSnoiMonthname{##2}}%
5883 }%
5884 \DTMifbool{sr-Cyrl-RS}{showyear}%
5885 {%
5886 \DTMsrCyrlRSmonthyearsep%
5887 % \end{macrocode}
5888 %\changes{2.1.0}{2019-11-22}{%
5889 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
5890 % and \cs{DTMDate}. Thanks Nicola!
5891 %}
5892 % \begin{macrocode}
5893 ##1\DTMfinaldot{}%
5894 }%
5895 {}%
5896 }%
5897 }%
5898 {% time style
5899 \renewcommand*\DTMdisplaytime[3]{%
5900 \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
5901 \DTMsrCyrlRStimesep\DTMtwodigits{##2}%
5902 \ifDTMshowseconds\DTMsrCyrlRStimesep\DTMtwodigits{##3}\fi
5903 }%
5904 }%
5905 {% zone style
5906 \DTMresetzones%
5907 \DTMsrCyrlRSzonemaps%
5908 \renewcommand*{\DTMdisplayzone}[2]{%
5909 \DTMifbool{sr-Cyrl-RS}{mapzone}%
5910 {\DTMusezonemapordefault{##1}{##2}}%
5911 {%
5912 \ifnum##1<0
5913 \else+\fi\DTMtwodigits{##1}%
5914 \ifDTMshowzoneminutes\DTMsrCyrlRStimesep\DTMtwodigits{##2}\fi
5915 }%
5916 }%
5917 }%
5918 {% full style
5919 \renewcommand*{\DTMdisplay}[9]{%
5920 \ifDTMshowdate%
5921 \DTMdisplaydate{##1}{##2}{##3}{##4}%
5922 \DTMsrCyrlRSdatetimesep%
5923 \fi
5924 \DTMdisplaytime{##5}{##6}{##7}%
5925 \ifDTMshowzone%
5926 \DTMsrCyrlRStimezonesep%
5927 \DTMdisplayzone{##8}{##9}%
5928 \fi
5929 }%
5930 \renewcommand*{\DTMDisplay}[9]{%
5931 \ifDTMshowdate%
5932 \DTMDisplaydate{##1}{##2}{##3}{##4}%
5933 \DTMsrCyrlRSdatetimesep%
5934 \fi
5935 \DTMdisplaytime{##5}{##6}{##7}%
5936 \ifDTMshowzone%
5937 \DTMsrCyrlRStimezonesep%
5938 \DTMdisplayzone{##8}{##9}%
5939 \fi
5940 }%
5941 }%
5942 % \end{macrocode}
5943 %
5944 %
5945 %\begin{macro}{\DTMsrCyrlRSmonthordinal}
5946 % Define the month ordinal format to be used by this style.
5947 % \begin{macrocode}
5948 \newcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
5949 \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
5950 % \end{macrocode}
5951 %\end{macro}
5952 %\changes{2.0.0}{2019-11-07}{%
5953 % Added a switch between multiple numeric month ordinal formats used in
5954 % Serbian.
5955 %}
5956 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5957 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5958 % Define a setting to switch between Arabic, uppercase Roman and lowercase
5959 % smallcaps Roman month format for the "srCyrlRS-numeric" style.
5960 % \begin{macrocode}
5961 \DTMdefchoicekey{sr-Cyrl-RS}{monthord}%
5962 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
5963 \ifcase\@dtm@nr\relax
5964 \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
5965 \DTMifbool{sr-Cyrl-RS}{leadingzero}%
5966 {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlRSdatesep}%
5967 \or%
5968 \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
5969 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
5970 {serbianordinalROMAN{##1}}}%
5971 \or%
5972 \renewcommand*{\DTMsrCyrlRSmonthordinal}[1]{%
5973 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
5974 {serbianordinalROMAN{##1}}}%
5975 \fi
5976 }
5977 % \end{macrocode}
5978 %\changes{2.0.0}{2019-11-07}{%
5979 % Fixed the (previously entirely wrong) numeric date style.
5980 %}
5981 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5982 %\changes{2.0.0}{2019-11-07}{%
5983 % Added weekday names.
5984 %}
5985 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
5986 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
5987 % Define numeric style.
5988 % \begin{macrocode}
5989 \DTMnewstyle%
5990 {sr-Cyrl-RS-numeric}% label
5991 {% date style
5992 \renewcommand*\DTMdisplaydate[4]{%
5993 \ifDTMshowdow%
5994 \ifnum##4>-1
5995 \DTMsrCyrlRSweekdayname{##4}%
5996 \DTMsrCyrlRSdowdaysep%
5997 \fi
5998 \fi
5999 \DTMifbool{sr-Cyrl-RS}{showdayofmonth}%
6000 {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
6001 {}%
6002 \DTMsrCyrlRSmonthordinal{##2}%
6003 \DTMifbool{sr-Cyrl-RS}{showyear}%
6004 {%
6005 \DTMsrCyrlRSmonthyearsep%
6006 % \end{macrocode}
6007 %\changes{2.1.0}{2019-11-22}{%
6008 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6009 % and \cs{DTMDate}. Thanks Nicola!
6010 %}
6011 % \begin{macrocode}
6012 ##1\DTMfinaldot{}%
6013 }%
6014 {}%
6015 }%
6016 \renewcommand*\DTMDisplaydate[4]{%
6017 \ifDTMshowdow%
6018 \ifnum##4>-1
6019 \DTMsrCyrlRSWeekdayname{##4}%
6020 \DTMsrCyrlRSdowdaysep%
6021 \fi
6022 \fi
6023 \DTMifbool{sr-Cyrl-RS}{showdayofmonth}%
6024 {\DTMsrCyrlRSdayordinal{##3}\DTMsrCyrlRSdaymonthsep}%
6025 {}%
6026 \DTMsrCyrlRSmonthordinal{##2}%
6027 \DTMifbool{sr-Cyrl-RS}{showyear}%
6028 {%
6029 \DTMsrCyrlRSmonthyearsep%
6030 % \end{macrocode}
6031 %\changes{2.1.0}{2019-11-22}{%
6032 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6033 % and \cs{DTMDate}. Thanks Nicola!
6034 %}
6035 % \begin{macrocode}
6036 ##1\DTMfinaldot{}%
6037 }%
6038 {}%
6039 }%
6040 }%
6041 {% time style
6042 \renewcommand*\DTMdisplaytime[3]{%
6043 \DTMifbool{sr-Cyrl-RS}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
6044 \DTMsrCyrlRStimesep\DTMtwodigits{##2}%
6045 \ifDTMshowseconds\DTMsrCyrlRStimesep\DTMtwodigits{##3}\fi
6046 }%
6047 }%
6048 {% zone style
6049 \DTMresetzones%
6050 \DTMsrCyrlRSzonemaps%
6051 \renewcommand*{\DTMdisplayzone}[2]{%
6052 \DTMifbool{sr-Cyrl-RS}{mapzone}%
6053 {\DTMusezonemapordefault{##1}{##2}}%
6054 {%
6055 \ifnum##1<0
6056 \else+\fi\DTMtwodigits{##1}%
6057 \ifDTMshowzoneminutes\DTMsrCyrlRStimesep\DTMtwodigits{##2}\fi
6058 }%
6059 }%
6060 }%
6061 {% full style
6062 \renewcommand*{\DTMdisplay}[9]{%
6063 \ifDTMshowdate%
6064 \DTMdisplaydate{##1}{##2}{##3}{##4}%
6065 \DTMsrCyrlRSdatetimesep%
6066 \fi
6067 \DTMdisplaytime{##5}{##6}{##7}%
6068 \ifDTMshowzone%
6069 \DTMsrCyrlRStimezonesep%
6070 \DTMdisplayzone{##8}{##9}%
6071 \fi
6072 }%
6073 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
6074 }
6075 % \end{macrocode}
6076 %
6077 %\begin{macro}{\DTMsr-Cyrl-RSzonemaps}
6078 % The time zone mappings are set through this command, which can be
6079 % redefined if extra mappings are required or mappings need to be
6080 % removed.
6081 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
6082 % \begin{macrocode}
6083 \newcommand*{\DTMsrCyrlRSzonemaps}{%
6084 \DTMdefzonemap{01}{00}{CET}%
6085 \DTMdefzonemap{02}{00}{CEST}%
6086 }
6087 % \end{macrocode}
6088 %\end{macro}
6089 % Switch style according to the \opt{useregional} setting.
6090 % \begin{macrocode}
6091 \DTMifcaseregional%
6092 {}% do nothing
6093 {\DTMsetstyle{sr-Cyrl-RS}}%
6094 {\DTMsetstyle{sr-Cyrl-RS-numeric}}%
6095 % \end{macrocode}
6096 % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent
6097 % \sty{babel} from resetting \cs{today}. (For this to work,
6098 % \sty{babel} must already have been loaded if it's required.)
6099 %\changes{1.1}{2019-09-14}{removed spurious space}
6100 %\changes{2.0.0}{2019-11-07}{%
6101 % Added regions.
6102 %}
6103 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6104 % \begin{macrocode}
6105 \ifcsundef{date\CurrentTrackedDialect}
6106 {%
6107 \ifundef\dateserbianc%
6108 {% do nothing
6109 }%
6110 {%
6111 \def\dateserbianc{%
6112 \DTMifcaseregional%
6113 {}% do nothing
6114 {\DTMsetstyle{sr-Cyrl-RS}}%
6115 {\DTMsetstyle{sr-Cyrl-RS-numeric}}%
6116 }%
6117 }%
6118 }%
6119 {%
6120 \csdef{date\CurrentTrackedDialect}{%
6121 \DTMifcaseregional%
6122 {}% do nothing
6123 % \end{macrocode}
6124 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
6125 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
6126 % \begin{macrocode}
6127 {\DTMsetstyle{sr-Cyrl-RS}}%
6128 {\DTMsetstyle{sr-Cyrl-RS-numeric}}%
6129 }%
6130 }%
6131 % \end{macrocode}
6132 %
6133 %\iffalse
6134 % \begin{macrocode}
6135 %</datetime2-sr-Cyrl-RS.ldf>
6136 % \end{macrocode}
6137 %\fi
6138 %
6139 %\iffalse
6140 % \begin{macrocode}
6141 %<*datetime2-sr-Cyrl-ME.ldf>
6142 % \end{macrocode}
6143 %\fi
6144 %
6145 %\subsection{Serbian \sty{sr-Cyrl-ME} Code
6146 % (\texttt{datetime2-sr-Cyrl-ME.ldf})}
6147 %\changes{1.0}{2015-03-24}{Initial release}
6148 %\changes{2.0.0}{2019-11-07}{%
6149 % Added regions, all settings made available to regions so all changes can be
6150 % region-specific.
6151 %}
6152 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6153 % \begin{macrocode}
6154 \ProvidesDateTimeModule{sr-Cyrl-ME}[2019/11/22 v2.1.0]
6155 % \end{macrocode}
6156 %\changes{2.0.0}{2019-11-07}{%
6157 % All localization strings loaded from base module.
6158 %}
6159 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6160 % Load appropriate regionless Serbian module.
6161 % \begin{macrocode}
6162 \RequireDateTimeModule{serbianc}
6163 % \end{macrocode}
6164 %
6165 %
6166 %
6167 %\subsubsection{Defining the \sty{sr-Cyrl-ME} style}
6168 %
6169 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6170 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
6171 % Allow the user a way of configuring the "sr-Cyrl-ME" and
6172 % "sr-Cyrl-ME-numeric" styles by providing macros for various format
6173 % elements.
6174 %
6175 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
6176 % case other date formats are also required.
6177 %
6178 %\begin{macro}{\DTMsrCyrlMEdowdaysep}
6179 % The separator between weekday and day.
6180 % \begin{macrocode}
6181 \newcommand*{\DTMsrCyrlMEdowdaysep}{,\space}
6182 % \end{macrocode}
6183 %\end{macro}
6184 %
6185 %
6186 %\begin{macro}{\DTMsrCyrlMEdaymonthsep}
6187 % The separator between the day and month for the text format.
6188 % \begin{macrocode}
6189 \newcommand*{\DTMsrCyrlMEdaymonthsep}{%
6190 \DTMtexorpdfstring{\protect~}{\space}%
6191 }
6192 % \end{macrocode}
6193 %\end{macro}
6194 %
6195 %\begin{macro}{\DTMsrCyrlMEmonthyearsep}
6196 % The separator between the month and year for the text format.
6197 % \begin{macrocode}
6198 \newcommand*{\DTMsrCyrlMEmonthyearsep}{\space}
6199 % \end{macrocode}
6200 %\end{macro}
6201 %
6202 %\begin{macro}{\DTMsrCyrlMEdatetimesep}
6203 % The separator between the date and time blocks in the full format (either
6204 % text or numeric).
6205 % \begin{macrocode}
6206 \newcommand*{\DTMsrCyrlMEdatetimesep}{\space}
6207 % \end{macrocode}
6208 %\end{macro}
6209 %
6210 %\begin{macro}{\DTMsrCyrlMEtimezonesep}
6211 % The separator between the time and zone blocks in the full format (either
6212 % text or numeric).
6213 % \begin{macrocode}
6214 \newcommand*{\DTMsrCyrlMEtimezonesep}{\space}
6215 % \end{macrocode}
6216 %\end{macro}
6217 %
6218 %\begin{macro}{\DTMsrCyrlMEdatesep}
6219 % The separator for the numeric date format.
6220 % \begin{macrocode}
6221 \newcommand*{\DTMsrCyrlMEdatesep}{.}
6222 % \end{macrocode}
6223 %\end{macro}
6224 %
6225 %\begin{macro}{\DTMsrCyrlMEtimesep}
6226 % The separator for the numeric time format.
6227 % \begin{macrocode}
6228 \newcommand*{\DTMsrCyrlMEtimesep}{.}
6229 % \end{macrocode}
6230 %\end{macro}
6231 %
6232 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
6233 % \begin{macrocode}
6234 \DTMdefkey{sr-Cyrl-ME}{dowdaysep}%
6235 {\renewcommand*{\DTMsr-Cyrl-MEdowdaysep}{#1}}
6236 \DTMdefkey{sr-Cyrl-ME}{daymonthsep}%
6237 {\renewcommand*{\DTMsr-Cyrl-MEdaymonthsep}{#1}}
6238 \DTMdefkey{sr-Cyrl-ME}{monthyearsep}%
6239 {\renewcommand*{\DTMsr-Cyrl-MEmonthyearsep}{#1}}
6240 \DTMdefkey{sr-Cyrl-ME}{datetimesep}%
6241 {\renewcommand*{\DTMsr-Cyrl-MEdatetimesep}{#1}}
6242 \DTMdefkey{sr-Cyrl-ME}{timezonesep}%
6243 {\renewcommand*{\DTMsr-Cyrl-MEtimezonesep}{#1}}
6244 \DTMdefkey{sr-Cyrl-ME}{datesep}%
6245 {\renewcommand*{\DTMsr-Cyrl-MEdatesep}{#1}}
6246 \DTMdefkey{sr-Cyrl-ME}{timesep}%
6247 {\renewcommand*{\DTMsr-Cyrl-MEtimesep}{#1}}
6248 % \end{macrocode}
6249 %
6250 %\subsubsection{Switches and settings}
6251 %
6252 %\changes{2.0.0}{2019-11-07}{%
6253 % Added weekday names.
6254 %}
6255 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6256 %\begin{macro}{\DTMsrCyrlMEweekdayname}
6257 % Define the weekday name, lowercase.
6258 % \begin{macrocode}
6259 \newcommand*{\DTMsrCyrlMEweekdayname}%
6260 {\DTMserbiancyrijweekdayname}
6261 % \end{macrocode}
6262 %\end{macro}
6263
6264 %\begin{macro}{\DTMsrCyrlMEweekdayname}
6265 % Define the weekday name, capitalized.
6266 % \begin{macrocode}
6267 \newcommand*{\DTMsrCyrlMEWeekdayname}%
6268 {\DTMserbiancyrijWeekdayname}
6269 % \end{macrocode}
6270 %\end{macro}
6271 %
6272 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
6273 %\changes{2.0.0}{2019-11-07}{%
6274 % Added a way to switch between Ekavian and Ijekavian pronunciation.
6275 %}
6276 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6277 %
6278 % \begin{macrocode}
6279 \DTMdefchoicekey{sr-Cyrl-ME}%
6280 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
6281 \ifcase\@dtm@nr\relax
6282 \renewcommand*{\DTMsrCyrlMEweekdayname}%
6283 {\DTMserbiancyrekweekdayname}%
6284 \renewcommand*{\DTMsrCyrlMEWeekdayname}%
6285 {\DTMserbiancyrekWeekdayname}%
6286 \or%
6287 \renewcommand*{\DTMsrCyrlMEweekdayname}%
6288 {\DTMserbiancyrijweekdayname}%
6289 \renewcommand*{\DTMsrCyrlMEWeekdayname}
6290 {\DTMserbiancyrijWeekdayname}%
6291 \fi
6292 }
6293 % \end{macrocode}
6294 %\changes{2.0.0}{2019-11-07}{%
6295 % Added a way to switch June, July alternate spellings.
6296 %}
6297 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6298 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6299 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
6300 % month spellings.
6301 % \begin{macrocode}
6302 \DTMdefboolkey{sr-Cyrl-ME}{monthi}[true]{}
6303 % \end{macrocode}
6304 % The default is without the "i" suffix.
6305 % \begin{macrocode}
6306 \DTMsetbool{sr-Cyrl-ME}{monthi}{false}
6307 % \end{macrocode}
6308 %\changes{2.0.0}{2019-11-07}{%
6309 % Added a switch for adding leading zeroes in day and month ordinals.
6310 %}
6311 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6312 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6313 % Define a boolean key that determines if the day and month ordinals should
6314 % have leading zeroes.
6315 % \begin{macrocode}
6316 \DTMdefboolkey{sr-Cyrl-ME}{leadingzero}[true]{}
6317 % \end{macrocode}
6318 % The default is to omit the leading zero.
6319 % \begin{macrocode}
6320 \DTMsetbool{sr-Cyrl-ME}{leadingzero}{false}
6321 % \end{macrocode}
6322 %
6323 %\begin{macro}{\DTMsrCyrlMEdayordinal}
6324 % Define the day ordinal format to be used by this style.
6325 % \begin{macrocode}
6326 \newcommand*{\DTMsrCyrlMEdayordinal}[1]{%
6327 \DTMifbool{sr-Cyrl-ME}{leadingzero}%
6328 {\DTMtwodigits{#1}}%
6329 {\number#1}\DTMsrCyrlMEdatesep}%
6330 % \end{macrocode}
6331 %\end{macro}
6332 %
6333 %\changes{2.1.0}{2019-11-22}{%
6334 % Removed year ordinal macro since year ordinals are handled differently now.
6335 %}
6336 %\changes{2.0.0}{2019-11-07}{%
6337 % Removed the option to switch between writing systems, since that is
6338 % accomplished by using different regions or regionless styles ("serbian" and
6339 % "serbianc" for example).
6340 %}
6341 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6342 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6343 % Define the month names.
6344 %
6345 %\begin{macro}{\DTMsrCyrlMEnoimonthname}
6346 % \begin{macrocode}
6347 \newcommand*{\DTMsrCyrlMEnoimonthname}{\DTMserbiancyrnoimonthname}
6348 % \end{macrocode}
6349 %\end{macro}
6350 %
6351 %\begin{macro}{\DTMsrCyrlMEnoiMonthname}
6352 % \begin{macrocode}
6353 \newcommand*{\DTMsrCyrlMEnoiMonthname}{\DTMserbiancyrnoiMonthname}
6354 % \end{macrocode}
6355 %\end{macro}
6356 %
6357 %\begin{macro}{\DTMsrCyrlMEimonthname}
6358 % \begin{macrocode}
6359 \newcommand*{\DTMsrCyrlMEimonthname}{\DTMserbiancyrimonthname}
6360 % \end{macrocode}
6361 %\end{macro}
6362 %
6363 %\begin{macro}{\DTMsrCyrlMEiMonthname}
6364 % \begin{macrocode}
6365 \newcommand*{\DTMsrCyrlMEiMonthname}{\DTMserbiancyriMonthname}
6366 % \end{macrocode}
6367 %\end{macro}
6368 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6369 % Define a boolean key that determines if the time zone mappings
6370 % should be used.
6371 % \begin{macrocode}
6372 \DTMdefboolkey{sr-Cyrl-ME}{mapzone}[true]{}
6373 % \end{macrocode}
6374 % The default is to use mappings.
6375 % \begin{macrocode}
6376 \DTMsetbool{sr-Cyrl-ME}{mapzone}{true}
6377 % \end{macrocode}
6378 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6379 % Define a boolean key that determines if the day of month should be
6380 % displayed.
6381 % \begin{macrocode}
6382 \DTMdefboolkey{sr-Cyrl-ME}{showdayofmonth}[true]{}
6383 % \end{macrocode}
6384 % The default is to show the day of month.
6385 % \begin{macrocode}
6386 \DTMsetbool{sr-Cyrl-ME}{showdayofmonth}{true}
6387 % \end{macrocode}
6388 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6389 % Define a boolean key that determines if the year should be
6390 % displayed.
6391 % \begin{macrocode}
6392 \DTMdefboolkey{sr-Cyrl-ME}{showyear}[true]{}
6393 % \end{macrocode}
6394 % The default is to show the year.
6395 % \begin{macrocode}
6396 \DTMsetbool{sr-Cyrl-ME}{showyear}{true}
6397 % \end{macrocode}
6398 %\changes{2.0.0}{2019-11-07}{%
6399 % Added weekday names.
6400 %}
6401 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6402 % \begin{macrocode}
6403 \DTMnewstyle%
6404 {sr-Cyrl-ME}% label
6405 {% date style
6406 \renewcommand*\DTMdisplaydate[4]{%
6407 \ifDTMshowdow%
6408 \ifnum##4>-1
6409 \DTMsrCyrlMEweekdayname{##4}%
6410 \DTMsrCyrlMEdowdaysep%
6411 \fi
6412 \fi
6413 \DTMifbool{sr-Cyrl-ME}{showdayofmonth}
6414 {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
6415 {}%
6416 \DTMifbool{sr-Cyrl-ME}{monthi}%
6417 {\DTMsrCyrlMEimonthname{##2}}%
6418 {\DTMsrCyrlMEnoimonthname{##2}}%
6419 \DTMifbool{sr-Cyrl-ME}{showyear}%
6420 {%
6421 \DTMsrCyrlMEmonthyearsep%
6422 % \end{macrocode}
6423 %\changes{2.1.0}{2019-11-22}{%
6424 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6425 % and \cs{DTMDate}. Thanks Nicola!
6426 %}
6427 % \begin{macrocode}
6428 ##1\DTMfinaldot{}%
6429 }%
6430 {}%
6431 }%
6432 \renewcommand*\DTMDisplaydate[4]{%
6433 \ifDTMshowdow%
6434 \ifnum##4>-1
6435 \DTMsrCyrlMEWeekdayname{##4}%
6436 \DTMsrCyrlMEdowdaysep%
6437 \fi
6438 \fi
6439 \DTMifbool{sr-Cyrl-ME}{showdayofmonth}
6440 {%
6441 \DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep%
6442 \DTMifbool{sr-Cyrl-ME}{monthi}%
6443 {\DTMsrCyrlMEimonthname{##2}}%
6444 {\DTMsrCyrlMEnoimonthname{##2}}%
6445 }%
6446 {%
6447 \DTMifbool{sr-Cyrl-ME}{monthi}%
6448 {\DTMsrCyrlMEiMonthname{##2}}%
6449 {\DTMsrCyrlMEnoiMonthname{##2}}%
6450 }%
6451 \DTMifbool{sr-Cyrl-ME}{showyear}%
6452 {%
6453 \DTMsrCyrlMEmonthyearsep%
6454 % \end{macrocode}
6455 %\changes{2.1.0}{2019-11-22}{%
6456 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6457 % and \cs{DTMDate}. Thanks Nicola!
6458 %}
6459 % \begin{macrocode}
6460 ##1\DTMfinaldot{}%
6461 }%
6462 {}%
6463 }%
6464 }%
6465 {% time style
6466 \renewcommand*\DTMdisplaytime[3]{%
6467 \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
6468 \DTMsrCyrlMEtimesep\DTMtwodigits{##2}%
6469 \ifDTMshowseconds\DTMsrCyrlMEtimesep\DTMtwodigits{##3}\fi
6470 }%
6471 }%
6472 {% zone style
6473 \DTMresetzones%
6474 \DTMsrCyrlMEzonemaps%
6475 \renewcommand*{\DTMdisplayzone}[2]{%
6476 \DTMifbool{sr-Cyrl-ME}{mapzone}%
6477 {\DTMusezonemapordefault{##1}{##2}}%
6478 {%
6479 \ifnum##1<0
6480 \else+\fi\DTMtwodigits{##1}%
6481 \ifDTMshowzoneminutes\DTMsrCyrlMEtimesep\DTMtwodigits{##2}\fi
6482 }%
6483 }%
6484 }%
6485 {% full style
6486 \renewcommand*{\DTMdisplay}[9]{%
6487 \ifDTMshowdate%
6488 \DTMdisplaydate{##1}{##2}{##3}{##4}%
6489 \DTMsrCyrlMEdatetimesep%
6490 \fi
6491 \DTMdisplaytime{##5}{##6}{##7}%
6492 \ifDTMshowzone%
6493 \DTMsrCyrlMEtimezonesep%
6494 \DTMdisplayzone{##8}{##9}%
6495 \fi
6496 }%
6497 \renewcommand*{\DTMDisplay}[9]{%
6498 \ifDTMshowdate%
6499 \DTMDisplaydate{##1}{##2}{##3}{##4}%
6500 \DTMsrCyrlMEdatetimesep%
6501 \fi
6502 \DTMdisplaytime{##5}{##6}{##7}%
6503 \ifDTMshowzone%
6504 \DTMsrCyrlMEtimezonesep%
6505 \DTMdisplayzone{##8}{##9}%
6506 \fi
6507 }%
6508 }%
6509 % \end{macrocode}
6510 %
6511 %
6512 %\begin{macro}{\DTMsrCyrlMEmonthordinal}
6513 % Define the month ordinal format to be used by this style.
6514 % \begin{macrocode}
6515 \newcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
6516 \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
6517 % \end{macrocode}
6518 %\end{macro}
6519 %\changes{2.0.0}{2019-11-07}{%
6520 % Added a switch between multiple numeric month ordinal formats used in
6521 % Serbian.
6522 %}
6523 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6524 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6525 % Define a setting to switch between Arabic, uppercase Roman and lowercase
6526 % smallcaps Roman month format for the "srCyrlME-numeric" style.
6527 % \begin{macrocode}
6528 \DTMdefchoicekey{sr-Cyrl-ME}{monthord}%
6529 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
6530 \ifcase\@dtm@nr\relax
6531 \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
6532 \DTMifbool{sr-Cyrl-ME}{leadingzero}%
6533 {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlMEdatesep}%
6534 \or%
6535 \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
6536 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
6537 {serbianordinalROMAN{##1}}}%
6538 \or%
6539 \renewcommand*{\DTMsrCyrlMEmonthordinal}[1]{%
6540 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
6541 {serbianordinalROMAN{##1}}}%
6542 \fi
6543 }
6544 % \end{macrocode}
6545 %\changes{2.0.0}{2019-11-07}{%
6546 % Fixed the (previously entirely wrong) numeric date style.
6547 %}
6548 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6549 %\changes{2.0.0}{2019-11-07}{%
6550 % Added weekday names.
6551 %}
6552 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6553 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6554 % Define numeric style.
6555 % \begin{macrocode}
6556 \DTMnewstyle%
6557 {sr-Cyrl-ME-numeric}% label
6558 {% date style
6559 \renewcommand*\DTMdisplaydate[4]{%
6560 \ifDTMshowdow%
6561 \ifnum##4>-1
6562 \DTMsrCyrlMEweekdayname{##4}%
6563 \DTMsrCyrlMEdowdaysep%
6564 \fi
6565 \fi
6566 \DTMifbool{sr-Cyrl-ME}{showdayofmonth}%
6567 {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
6568 {}%
6569 \DTMsrCyrlMEmonthordinal{##2}%
6570 \DTMifbool{sr-Cyrl-ME}{showyear}%
6571 {%
6572 \DTMsrCyrlMEmonthyearsep%
6573 % \end{macrocode}
6574 %\changes{2.1.0}{2019-11-22}{%
6575 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6576 % and \cs{DTMDate}. Thanks Nicola!
6577 %}
6578 % \begin{macrocode}
6579 ##1\DTMfinaldot{}%
6580 }%
6581 {}%
6582 }%
6583 \renewcommand*\DTMDisplaydate[4]{%
6584 \ifDTMshowdow%
6585 \ifnum##4>-1
6586 \DTMsrCyrlMEWeekdayname{##4}%
6587 \DTMsrCyrlMEdowdaysep%
6588 \fi
6589 \fi
6590 \DTMifbool{sr-Cyrl-ME}{showdayofmonth}%
6591 {\DTMsrCyrlMEdayordinal{##3}\DTMsrCyrlMEdaymonthsep}%
6592 {}%
6593 \DTMsrCyrlMEmonthordinal{##2}%
6594 \DTMifbool{sr-Cyrl-ME}{showyear}%
6595 {%
6596 \DTMsrCyrlMEmonthyearsep%
6597 % \end{macrocode}
6598 %\changes{2.1.0}{2019-11-22}{%
6599 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6600 % and \cs{DTMDate}. Thanks Nicola!
6601 %}
6602 % \begin{macrocode}
6603 ##1\DTMfinaldot{}%
6604 }%
6605 {}%
6606 }%
6607 }%
6608 {% time style
6609 \renewcommand*\DTMdisplaytime[3]{%
6610 \DTMifbool{sr-Cyrl-ME}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
6611 \DTMsrCyrlMEtimesep\DTMtwodigits{##2}%
6612 \ifDTMshowseconds\DTMsrCyrlMEtimesep\DTMtwodigits{##3}\fi
6613 }%
6614 }%
6615 {% zone style
6616 \DTMresetzones%
6617 \DTMsrCyrlMEzonemaps%
6618 \renewcommand*{\DTMdisplayzone}[2]{%
6619 \DTMifbool{sr-Cyrl-ME}{mapzone}%
6620 {\DTMusezonemapordefault{##1}{##2}}%
6621 {%
6622 \ifnum##1<0
6623 \else+\fi\DTMtwodigits{##1}%
6624 \ifDTMshowzoneminutes\DTMsrCyrlMEtimesep\DTMtwodigits{##2}\fi
6625 }%
6626 }%
6627 }%
6628 {% full style
6629 \renewcommand*{\DTMdisplay}[9]{%
6630 \ifDTMshowdate%
6631 \DTMdisplaydate{##1}{##2}{##3}{##4}%
6632 \DTMsrCyrlMEdatetimesep%
6633 \fi
6634 \DTMdisplaytime{##5}{##6}{##7}%
6635 \ifDTMshowzone%
6636 \DTMsrCyrlMEtimezonesep%
6637 \DTMdisplayzone{##8}{##9}%
6638 \fi
6639 }%
6640 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
6641 }
6642 % \end{macrocode}
6643 %
6644 %\begin{macro}{\DTMsr-Cyrl-MEzonemaps}
6645 % The time zone mappings are set through this command, which can be
6646 % redefined if extra mappings are required or mappings need to be
6647 % removed.
6648 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
6649 % \begin{macrocode}
6650 \newcommand*{\DTMsrCyrlMEzonemaps}{%
6651 \DTMdefzonemap{01}{00}{CET}%
6652 \DTMdefzonemap{02}{00}{CEST}%
6653 }
6654 % \end{macrocode}
6655 %\end{macro}
6656 % Switch style according to the \opt{useregional} setting.
6657 % \begin{macrocode}
6658 \DTMifcaseregional%
6659 {}% do nothing
6660 {\DTMsetstyle{sr-Cyrl-ME}}%
6661 {\DTMsetstyle{sr-Cyrl-ME-numeric}}%
6662 % \end{macrocode}
6663 % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent
6664 % \sty{babel} from resetting \cs{today}. (For this to work,
6665 % \sty{babel} must already have been loaded if it's required.)
6666 %\changes{1.1}{2019-09-14}{removed spurious space}
6667 %\changes{2.0.0}{2019-11-07}{%
6668 % Added regions.
6669 %}
6670 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6671 % \begin{macrocode}
6672 \ifcsundef{date\CurrentTrackedDialect}
6673 {%
6674 \ifundef\dateserbianc%
6675 {% do nothing
6676 }%
6677 {%
6678 \def\dateserbianc{%
6679 \DTMifcaseregional%
6680 {}% do nothing
6681 {\DTMsetstyle{sr-Cyrl-ME}}%
6682 {\DTMsetstyle{sr-Cyrl-ME-numeric}}%
6683 }%
6684 }%
6685 }%
6686 {%
6687 \csdef{date\CurrentTrackedDialect}{%
6688 \DTMifcaseregional%
6689 {}% do nothing
6690 % \end{macrocode}
6691 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
6692 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
6693 % \begin{macrocode}
6694 {\DTMsetstyle{sr-Cyrl-ME}}%
6695 {\DTMsetstyle{sr-Cyrl-ME-numeric}}%
6696 }%
6697 }%
6698 % \end{macrocode}
6699 %
6700 %\iffalse
6701 % \begin{macrocode}
6702 %</datetime2-sr-Cyrl-ME.ldf>
6703 % \end{macrocode}
6704 %\fi
6705 %
6706 %\iffalse
6707 % \begin{macrocode}
6708 %<*datetime2-sr-Cyrl-BA.ldf>
6709 % \end{macrocode}
6710 %\fi
6711 %
6712 %\subsection{Serbian \sty{sr-Cyrl-BA} Code
6713 % (\texttt{datetime2-sr-Cyrl-BA.ldf})}
6714 %\changes{1.0}{2015-03-24}{Initial release}
6715 %\changes{2.0.0}{2019-11-07}{%
6716 % Added regions, all settings made available to regions so all changes can be
6717 % region-specific.
6718 %}
6719 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6720 % \begin{macrocode}
6721 \ProvidesDateTimeModule{sr-Cyrl-BA}[2019/11/22 v2.1.0]
6722 % \end{macrocode}
6723 %\changes{2.0.0}{2019-11-07}{%
6724 % All localization strings loaded from base module.
6725 %}
6726 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6727 % Load appropriate regionless Serbian module.
6728 % \begin{macrocode}
6729 \RequireDateTimeModule{serbianc}
6730 % \end{macrocode}
6731 %
6732 %
6733 %
6734 %\subsubsection{Defining the \sty{sr-Cyrl-BA} style}
6735 %
6736 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6737 % \changes{2.0.1}{2019-11-11}{Fixed region name error.}
6738 % Allow the user a way of configuring the "sr-Cyrl-BA" and
6739 % "sr-Cyrl-BA-numeric" styles by providing macros for various format
6740 % elements.
6741 %
6742 % This doesn't use the package-wide separators such as \cs{dtm@datetimesep} in
6743 % case other date formats are also required.
6744 %
6745 %\begin{macro}{\DTMsrCyrlBAdowdaysep}
6746 % The separator between weekday and day.
6747 % \begin{macrocode}
6748 \newcommand*{\DTMsrCyrlBAdowdaysep}{,\space}
6749 % \end{macrocode}
6750 %\end{macro}
6751 %
6752 %
6753 %\begin{macro}{\DTMsrCyrlBAdaymonthsep}
6754 % The separator between the day and month for the text format.
6755 % \begin{macrocode}
6756 \newcommand*{\DTMsrCyrlBAdaymonthsep}{%
6757 \DTMtexorpdfstring{\protect~}{\space}%
6758 }
6759 % \end{macrocode}
6760 %\end{macro}
6761 %
6762 %\begin{macro}{\DTMsrCyrlBAmonthyearsep}
6763 % The separator between the month and year for the text format.
6764 % \begin{macrocode}
6765 \newcommand*{\DTMsrCyrlBAmonthyearsep}{\space}
6766 % \end{macrocode}
6767 %\end{macro}
6768 %
6769 %\begin{macro}{\DTMsrCyrlBAdatetimesep}
6770 % The separator between the date and time blocks in the full format (either
6771 % text or numeric).
6772 % \begin{macrocode}
6773 \newcommand*{\DTMsrCyrlBAdatetimesep}{\space}
6774 % \end{macrocode}
6775 %\end{macro}
6776 %
6777 %\begin{macro}{\DTMsrCyrlBAtimezonesep}
6778 % The separator between the time and zone blocks in the full format (either
6779 % text or numeric).
6780 % \begin{macrocode}
6781 \newcommand*{\DTMsrCyrlBAtimezonesep}{\space}
6782 % \end{macrocode}
6783 %\end{macro}
6784 %
6785 %\begin{macro}{\DTMsrCyrlBAdatesep}
6786 % The separator for the numeric date format.
6787 % \begin{macrocode}
6788 \newcommand*{\DTMsrCyrlBAdatesep}{.}
6789 % \end{macrocode}
6790 %\end{macro}
6791 %
6792 %\begin{macro}{\DTMsrCyrlBAtimesep}
6793 % The separator for the numeric time format.
6794 % \begin{macrocode}
6795 \newcommand*{\DTMsrCyrlBAtimesep}{.}
6796 % \end{macrocode}
6797 %\end{macro}
6798 %
6799 %Provide keys that can be used in \cs{DTMlangsetup} to set these separators.
6800 % \begin{macrocode}
6801 \DTMdefkey{sr-Cyrl-BA}{dowdaysep}%
6802 {\renewcommand*{\DTMsr-Cyrl-BAdowdaysep}{#1}}
6803 \DTMdefkey{sr-Cyrl-BA}{daymonthsep}%
6804 {\renewcommand*{\DTMsr-Cyrl-BAdaymonthsep}{#1}}
6805 \DTMdefkey{sr-Cyrl-BA}{monthyearsep}%
6806 {\renewcommand*{\DTMsr-Cyrl-BAmonthyearsep}{#1}}
6807 \DTMdefkey{sr-Cyrl-BA}{datetimesep}%
6808 {\renewcommand*{\DTMsr-Cyrl-BAdatetimesep}{#1}}
6809 \DTMdefkey{sr-Cyrl-BA}{timezonesep}%
6810 {\renewcommand*{\DTMsr-Cyrl-BAtimezonesep}{#1}}
6811 \DTMdefkey{sr-Cyrl-BA}{datesep}%
6812 {\renewcommand*{\DTMsr-Cyrl-BAdatesep}{#1}}
6813 \DTMdefkey{sr-Cyrl-BA}{timesep}%
6814 {\renewcommand*{\DTMsr-Cyrl-BAtimesep}{#1}}
6815 % \end{macrocode}
6816 %
6817 %\subsubsection{Switches and settings}
6818 %
6819 %\changes{2.0.0}{2019-11-07}{%
6820 % Added weekday names.
6821 %}
6822 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6823 %\begin{macro}{\DTMsrCyrlBAweekdayname}
6824 % Define the weekday name, lowercase.
6825 % \begin{macrocode}
6826 \newcommand*{\DTMsrCyrlBAweekdayname}%
6827 {\DTMserbiancyrijweekdayname}
6828 % \end{macrocode}
6829 %\end{macro}
6830
6831 %\begin{macro}{\DTMsrCyrlBAweekdayname}
6832 % Define the weekday name, capitalized.
6833 % \begin{macrocode}
6834 \newcommand*{\DTMsrCyrlBAWeekdayname}%
6835 {\DTMserbiancyrijWeekdayname}
6836 % \end{macrocode}
6837 %\end{macro}
6838 %
6839 % Provide a way to switch between Ekavian and Ijekavian pronunciation.
6840 %\changes{2.0.0}{2019-11-07}{%
6841 % Added a way to switch between Ekavian and Ijekavian pronunciation.
6842 %}
6843 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6844 %
6845 % \begin{macrocode}
6846 \DTMdefchoicekey{sr-Cyrl-BA}%
6847 {pronunciation}[\@dtm@val\@dtm@nr]{ekavian,ijekavian}{%
6848 \ifcase\@dtm@nr\relax
6849 \renewcommand*{\DTMsrCyrlBAweekdayname}%
6850 {\DTMserbiancyrekweekdayname}%
6851 \renewcommand*{\DTMsrCyrlBAWeekdayname}%
6852 {\DTMserbiancyrekWeekdayname}%
6853 \or%
6854 \renewcommand*{\DTMsrCyrlBAweekdayname}%
6855 {\DTMserbiancyrijweekdayname}%
6856 \renewcommand*{\DTMsrCyrlBAWeekdayname}
6857 {\DTMserbiancyrijWeekdayname}%
6858 \fi
6859 }
6860 % \end{macrocode}
6861 %\changes{2.0.0}{2019-11-07}{%
6862 % Added a way to switch June, July alternate spellings.
6863 %}
6864 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6865 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6866 % Define a boolean key that can switch between (jun, jul) and (juni, juli)
6867 % month spellings.
6868 % \begin{macrocode}
6869 \DTMdefboolkey{sr-Cyrl-BA}{monthi}[true]{}
6870 % \end{macrocode}
6871 % The default is without the "i" suffix.
6872 % \begin{macrocode}
6873 \DTMsetbool{sr-Cyrl-BA}{monthi}{false}
6874 % \end{macrocode}
6875 %\changes{2.0.0}{2019-11-07}{%
6876 % Added a switch for adding leading zeroes in day and month ordinals.
6877 %}
6878 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6879 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6880 % Define a boolean key that determines if the day and month ordinals should
6881 % have leading zeroes.
6882 % \begin{macrocode}
6883 \DTMdefboolkey{sr-Cyrl-BA}{leadingzero}[true]{}
6884 % \end{macrocode}
6885 % The default is to omit the leading zero.
6886 % \begin{macrocode}
6887 \DTMsetbool{sr-Cyrl-BA}{leadingzero}{false}
6888 % \end{macrocode}
6889 %
6890 %\begin{macro}{\DTMsrCyrlBAdayordinal}
6891 % Define the day ordinal format to be used by this style.
6892 % \begin{macrocode}
6893 \newcommand*{\DTMsrCyrlBAdayordinal}[1]{%
6894 \DTMifbool{sr-Cyrl-BA}{leadingzero}%
6895 {\DTMtwodigits{#1}}%
6896 {\number#1}\DTMsrCyrlBAdatesep}%
6897 % \end{macrocode}
6898 %\end{macro}
6899 %
6900 %\changes{2.1.0}{2019-11-22}{%
6901 % Removed year ordinal macro since year ordinals are handled differently now.
6902 %}
6903 %\changes{2.0.0}{2019-11-07}{%
6904 % Removed the option to switch between writing systems, since that is
6905 % accomplished by using different regions or regionless styles ("serbian" and
6906 % "serbianc" for example).
6907 %}
6908 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6909 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6910 % Define the month names.
6911 %
6912 %\begin{macro}{\DTMsrCyrlBAnoimonthname}
6913 % \begin{macrocode}
6914 \newcommand*{\DTMsrCyrlBAnoimonthname}{\DTMserbiancyrnoimonthname}
6915 % \end{macrocode}
6916 %\end{macro}
6917 %
6918 %\begin{macro}{\DTMsrCyrlBAnoiMonthname}
6919 % \begin{macrocode}
6920 \newcommand*{\DTMsrCyrlBAnoiMonthname}{\DTMserbiancyrnoiMonthname}
6921 % \end{macrocode}
6922 %\end{macro}
6923 %
6924 %\begin{macro}{\DTMsrCyrlBAimonthname}
6925 % \begin{macrocode}
6926 \newcommand*{\DTMsrCyrlBAimonthname}{\DTMserbiancyrimonthname}
6927 % \end{macrocode}
6928 %\end{macro}
6929 %
6930 %\begin{macro}{\DTMsrCyrlBAiMonthname}
6931 % \begin{macrocode}
6932 \newcommand*{\DTMsrCyrlBAiMonthname}{\DTMserbiancyriMonthname}
6933 % \end{macrocode}
6934 %\end{macro}
6935 %\changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6936 % Define a boolean key that determines if the time zone mappings
6937 % should be used.
6938 % \begin{macrocode}
6939 \DTMdefboolkey{sr-Cyrl-BA}{mapzone}[true]{}
6940 % \end{macrocode}
6941 % The default is to use mappings.
6942 % \begin{macrocode}
6943 \DTMsetbool{sr-Cyrl-BA}{mapzone}{true}
6944 % \end{macrocode}
6945 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6946 % Define a boolean key that determines if the day of month should be
6947 % displayed.
6948 % \begin{macrocode}
6949 \DTMdefboolkey{sr-Cyrl-BA}{showdayofmonth}[true]{}
6950 % \end{macrocode}
6951 % The default is to show the day of month.
6952 % \begin{macrocode}
6953 \DTMsetbool{sr-Cyrl-BA}{showdayofmonth}{true}
6954 % \end{macrocode}
6955 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
6956 % Define a boolean key that determines if the year should be
6957 % displayed.
6958 % \begin{macrocode}
6959 \DTMdefboolkey{sr-Cyrl-BA}{showyear}[true]{}
6960 % \end{macrocode}
6961 % The default is to show the year.
6962 % \begin{macrocode}
6963 \DTMsetbool{sr-Cyrl-BA}{showyear}{true}
6964 % \end{macrocode}
6965 %\changes{2.0.0}{2019-11-07}{%
6966 % Added weekday names.
6967 %}
6968 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
6969 % \begin{macrocode}
6970 \DTMnewstyle%
6971 {sr-Cyrl-BA}% label
6972 {% date style
6973 \renewcommand*\DTMdisplaydate[4]{%
6974 \ifDTMshowdow%
6975 \ifnum##4>-1
6976 \DTMsrCyrlBAweekdayname{##4}%
6977 \DTMsrCyrlBAdowdaysep%
6978 \fi
6979 \fi
6980 \DTMifbool{sr-Cyrl-BA}{showdayofmonth}
6981 {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
6982 {}%
6983 \DTMifbool{sr-Cyrl-BA}{monthi}%
6984 {\DTMsrCyrlBAimonthname{##2}}%
6985 {\DTMsrCyrlBAnoimonthname{##2}}%
6986 \DTMifbool{sr-Cyrl-BA}{showyear}%
6987 {%
6988 \DTMsrCyrlBAmonthyearsep%
6989 % \end{macrocode}
6990 %\changes{2.1.0}{2019-11-22}{%
6991 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
6992 % and \cs{DTMDate}. Thanks Nicola!
6993 %}
6994 % \begin{macrocode}
6995 ##1\DTMfinaldot{}%
6996 }%
6997 {}%
6998 }%
6999 \renewcommand*\DTMDisplaydate[4]{%
7000 \ifDTMshowdow%
7001 \ifnum##4>-1
7002 \DTMsrCyrlBAWeekdayname{##4}%
7003 \DTMsrCyrlBAdowdaysep%
7004 \fi
7005 \fi
7006 \DTMifbool{sr-Cyrl-BA}{showdayofmonth}
7007 {%
7008 \DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep%
7009 \DTMifbool{sr-Cyrl-BA}{monthi}%
7010 {\DTMsrCyrlBAimonthname{##2}}%
7011 {\DTMsrCyrlBAnoimonthname{##2}}%
7012 }%
7013 {%
7014 \DTMifbool{sr-Cyrl-BA}{monthi}%
7015 {\DTMsrCyrlBAiMonthname{##2}}%
7016 {\DTMsrCyrlBAnoiMonthname{##2}}%
7017 }%
7018 \DTMifbool{sr-Cyrl-BA}{showyear}%
7019 {%
7020 \DTMsrCyrlBAmonthyearsep%
7021 % \end{macrocode}
7022 %\changes{2.1.0}{2019-11-22}{%
7023 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
7024 % and \cs{DTMDate}. Thanks Nicola!
7025 %}
7026 % \begin{macrocode}
7027 ##1\DTMfinaldot{}%
7028 }%
7029 {}%
7030 }%
7031 }%
7032 {% time style
7033 \renewcommand*\DTMdisplaytime[3]{%
7034 \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
7035 \DTMsrCyrlBAtimesep\DTMtwodigits{##2}%
7036 \ifDTMshowseconds\DTMsrCyrlBAtimesep\DTMtwodigits{##3}\fi
7037 }%
7038 }%
7039 {% zone style
7040 \DTMresetzones%
7041 \DTMsrCyrlBAzonemaps%
7042 \renewcommand*{\DTMdisplayzone}[2]{%
7043 \DTMifbool{sr-Cyrl-BA}{mapzone}%
7044 {\DTMusezonemapordefault{##1}{##2}}%
7045 {%
7046 \ifnum##1<0
7047 \else+\fi\DTMtwodigits{##1}%
7048 \ifDTMshowzoneminutes\DTMsrCyrlBAtimesep\DTMtwodigits{##2}\fi
7049 }%
7050 }%
7051 }%
7052 {% full style
7053 \renewcommand*{\DTMdisplay}[9]{%
7054 \ifDTMshowdate%
7055 \DTMdisplaydate{##1}{##2}{##3}{##4}%
7056 \DTMsrCyrlBAdatetimesep%
7057 \fi
7058 \DTMdisplaytime{##5}{##6}{##7}%
7059 \ifDTMshowzone%
7060 \DTMsrCyrlBAtimezonesep%
7061 \DTMdisplayzone{##8}{##9}%
7062 \fi
7063 }%
7064 \renewcommand*{\DTMDisplay}[9]{%
7065 \ifDTMshowdate%
7066 \DTMDisplaydate{##1}{##2}{##3}{##4}%
7067 \DTMsrCyrlBAdatetimesep%
7068 \fi
7069 \DTMdisplaytime{##5}{##6}{##7}%
7070 \ifDTMshowzone%
7071 \DTMsrCyrlBAtimezonesep%
7072 \DTMdisplayzone{##8}{##9}%
7073 \fi
7074 }%
7075 }%
7076 % \end{macrocode}
7077 %
7078 %
7079 %\begin{macro}{\DTMsrCyrlBAmonthordinal}
7080 % Define the month ordinal format to be used by this style.
7081 % \begin{macrocode}
7082 \newcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
7083 \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{#1}}{\number#1}.}%
7084 % \end{macrocode}
7085 %\end{macro}
7086 %\changes{2.0.0}{2019-11-07}{%
7087 % Added a switch between multiple numeric month ordinal formats used in
7088 % Serbian.
7089 %}
7090 % \changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
7091 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
7092 % Define a setting to switch between Arabic, uppercase Roman and lowercase
7093 % smallcaps Roman month format for the "srCyrlBA-numeric" style.
7094 % \begin{macrocode}
7095 \DTMdefchoicekey{sr-Cyrl-BA}{monthord}%
7096 [\@dtm@val\@dtm@nr]{arabic,roman,romanlsc}{%
7097 \ifcase\@dtm@nr\relax
7098 \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
7099 \DTMifbool{sr-Cyrl-BA}{leadingzero}%
7100 {\DTMtwodigits{##1}}{\number##1}\DTMsrCyrlBAdatesep}%
7101 \or%
7102 \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
7103 \DTMtexorpdfstring{\protect\DTMserbianordinalROMAN{##1}}%
7104 {serbianordinalROMAN{##1}}}%
7105 \or%
7106 \renewcommand*{\DTMsrCyrlBAmonthordinal}[1]{%
7107 \DTMtexorpdfstring{\textsc{\protect\DTMserbianordinalroman{##1}}}%
7108 {serbianordinalROMAN{##1}}}%
7109 \fi
7110 }
7111 % \end{macrocode}
7112 %\changes{2.0.0}{2019-11-07}{%
7113 % Fixed the (previously entirely wrong) numeric date style.
7114 %}
7115 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
7116 %\changes{2.0.0}{2019-11-07}{%
7117 % Added weekday names.
7118 %}
7119 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
7120 % \changes{2.0.1}{2019-11-11}{Removed extraneous paragraph indentation.}
7121 % Define numeric style.
7122 % \begin{macrocode}
7123 \DTMnewstyle%
7124 {sr-Cyrl-BA-numeric}% label
7125 {% date style
7126 \renewcommand*\DTMdisplaydate[4]{%
7127 \ifDTMshowdow%
7128 \ifnum##4>-1
7129 \DTMsrCyrlBAweekdayname{##4}%
7130 \DTMsrCyrlBAdowdaysep%
7131 \fi
7132 \fi
7133 \DTMifbool{sr-Cyrl-BA}{showdayofmonth}%
7134 {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
7135 {}%
7136 \DTMsrCyrlBAmonthordinal{##2}%
7137 \DTMifbool{sr-Cyrl-BA}{showyear}%
7138 {%
7139 \DTMsrCyrlBAmonthyearsep%
7140 % \end{macrocode}
7141 %\changes{2.1.0}{2019-11-22}{%
7142 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
7143 % and \cs{DTMDate}. Thanks Nicola!
7144 %}
7145 % \begin{macrocode}
7146 ##1\DTMfinaldot{}%
7147 }%
7148 {}%
7149 }%
7150 \renewcommand*\DTMDisplaydate[4]{%
7151 \ifDTMshowdow%
7152 \ifnum##4>-1
7153 \DTMsrCyrlBAWeekdayname{##4}%
7154 \DTMsrCyrlBAdowdaysep%
7155 \fi
7156 \fi
7157 \DTMifbool{sr-Cyrl-BA}{showdayofmonth}%
7158 {\DTMsrCyrlBAdayordinal{##3}\DTMsrCyrlBAdaymonthsep}%
7159 {}%
7160 \DTMsrCyrlBAmonthordinal{##2}%
7161 \DTMifbool{sr-Cyrl-BA}{showyear}%
7162 {%
7163 \DTMsrCyrlBAmonthyearsep%
7164 % \end{macrocode}
7165 %\changes{2.1.0}{2019-11-22}{%
7166 % Adapted the code to omit the final dot on starred version of \cs{DTMdate}
7167 % and \cs{DTMDate}. Thanks Nicola!
7168 %}
7169 % \begin{macrocode}
7170 ##1\DTMfinaldot{}%
7171 }%
7172 {}%
7173 }%
7174 }%
7175 {% time style
7176 \renewcommand*\DTMdisplaytime[3]{%
7177 \DTMifbool{sr-Cyrl-BA}{leadingzero}{\DTMtwodigits{##1}}{\number##1}%
7178 \DTMsrCyrlBAtimesep\DTMtwodigits{##2}%
7179 \ifDTMshowseconds\DTMsrCyrlBAtimesep\DTMtwodigits{##3}\fi
7180 }%
7181 }%
7182 {% zone style
7183 \DTMresetzones%
7184 \DTMsrCyrlBAzonemaps%
7185 \renewcommand*{\DTMdisplayzone}[2]{%
7186 \DTMifbool{sr-Cyrl-BA}{mapzone}%
7187 {\DTMusezonemapordefault{##1}{##2}}%
7188 {%
7189 \ifnum##1<0
7190 \else+\fi\DTMtwodigits{##1}%
7191 \ifDTMshowzoneminutes\DTMsrCyrlBAtimesep\DTMtwodigits{##2}\fi
7192 }%
7193 }%
7194 }%
7195 {% full style
7196 \renewcommand*{\DTMdisplay}[9]{%
7197 \ifDTMshowdate%
7198 \DTMdisplaydate{##1}{##2}{##3}{##4}%
7199 \DTMsrCyrlBAdatetimesep%
7200 \fi
7201 \DTMdisplaytime{##5}{##6}{##7}%
7202 \ifDTMshowzone%
7203 \DTMsrCyrlBAtimezonesep%
7204 \DTMdisplayzone{##8}{##9}%
7205 \fi
7206 }%
7207 \renewcommand*{\DTMDisplay}{\DTMdisplay}%
7208 }
7209 % \end{macrocode}
7210 %
7211 %\begin{macro}{\DTMsr-Cyrl-BAzonemaps}
7212 % The time zone mappings are set through this command, which can be
7213 % redefined if extra mappings are required or mappings need to be
7214 % removed.
7215 %\changes{2.0.1}{2019-11-11}{Replaced wrong parameter for zonemapping.}
7216 % \begin{macrocode}
7217 \newcommand*{\DTMsrCyrlBAzonemaps}{%
7218 \DTMdefzonemap{01}{00}{CET}%
7219 \DTMdefzonemap{02}{00}{CEST}%
7220 }
7221 % \end{macrocode}
7222 %\end{macro}
7223 % Switch style according to the \opt{useregional} setting.
7224 % \begin{macrocode}
7225 \DTMifcaseregional%
7226 {}% do nothing
7227 {\DTMsetstyle{sr-Cyrl-BA}}%
7228 {\DTMsetstyle{sr-Cyrl-BA-numeric}}%
7229 % \end{macrocode}
7230 % Redefine \cs{dateserbianc} (or \cs{date}\meta{dialect}) to prevent
7231 % \sty{babel} from resetting \cs{today}. (For this to work,
7232 % \sty{babel} must already have been loaded if it's required.)
7233 %\changes{1.1}{2019-09-14}{removed spurious space}
7234 %\changes{2.0.0}{2019-11-07}{%
7235 % Added regions.
7236 %}
7237 %\changes{2.0.1}{2019-11-11}{Adopted semantic versioning.}
7238 % \begin{macrocode}
7239 \ifcsundef{date\CurrentTrackedDialect}
7240 {%
7241 \ifundef\dateserbianc%
7242 {% do nothing
7243 }%
7244 {%
7245 \def\dateserbianc{%
7246 \DTMifcaseregional%
7247 {}% do nothing
7248 {\DTMsetstyle{sr-Cyrl-BA}}%
7249 {\DTMsetstyle{sr-Cyrl-BA-numeric}}%
7250 }%
7251 }%
7252 }%
7253 {%
7254 \csdef{date\CurrentTrackedDialect}{%
7255 \DTMifcaseregional%
7256 {}% do nothing
7257 % \end{macrocode}
7258 %\changes{2.0.1}{2019-11-11}{Fixed non-regional variant for regional code.}
7259 %\changes{2.1.0}{2019-11-22}{Reverted wrong regional variant changes.}
7260 % \begin{macrocode}
7261 {\DTMsetstyle{sr-Cyrl-BA}}%
7262 {\DTMsetstyle{sr-Cyrl-BA-numeric}}%
7263 }%
7264 }%
7265 % \end{macrocode}
7266 %
7267 %\iffalse
7268 % \begin{macrocode}
7269 %</datetime2-sr-Cyrl-BA.ldf>
7270 % \end{macrocode}
7271 %\fi
7272 %
7273 %
7274 %
7275 %\restoregeometry{}
7276 %\Finale
7277 \endinput