| 1 |
%\iffalse |
| 2 |
% datetime.dtx generated using makedtx version 1.1 (c) Nicola Talbot |
| 3 |
% Command line args: |
| 4 |
% -doc "datetime-manual.tex" |
| 5 |
% -setambles ".*\.perl=>\nopreamble\nopostamble" |
| 6 |
% -author "Nicola Talbot" |
| 7 |
% -macrocode "datetime.perl" |
| 8 |
% -comment "datetime.perl" |
| 9 |
% -comment "dt-.+\.tex" |
| 10 |
% -src "(.+)\.(sty)=>\1.\2" |
| 11 |
% -src "(.+)\.(def)=>\1.\2" |
| 12 |
% -src "(dt-.+)\.(tex)=>\1.\2" |
| 13 |
% -src "datetime.perl\Z=>datetime.perl" |
| 14 |
% datetime |
| 15 |
% Created on 2015/3/20 16:54 |
| 16 |
%\fi |
| 17 |
%\iffalse |
| 18 |
%<*package> |
| 19 |
%% \CharacterTable |
| 20 |
%% {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 |
| 21 |
%% 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 |
| 22 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 23 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 24 |
%% Dollar \$ Percent \% Ampersand \& |
| 25 |
%% Acute accent \' Left paren \( Right paren \) |
| 26 |
%% Asterisk \* Plus \+ Comma \, |
| 27 |
%% Minus \- Point \. Solidus \/ |
| 28 |
%% Colon \: Semicolon \; Less than \< |
| 29 |
%% Equals \= Greater than \> Question mark \? |
| 30 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 31 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 32 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 33 |
%% Right brace \} Tilde \~} |
| 34 |
%</package> |
| 35 |
%\fi |
| 36 |
% \iffalse |
| 37 |
% Doc-Source file to use with LaTeX2e |
| 38 |
% Copyright (C) 2015 Nicola Talbot, all rights reserved. |
| 39 |
% \fi |
| 40 |
% \iffalse |
| 41 |
%<*driver> |
| 42 |
\documentclass{nlctdoc} |
| 43 |
|
| 44 |
\usepackage[colorlinks, |
| 45 |
bookmarks, |
| 46 |
bookmarksopen, |
| 47 |
hyperindex=false, |
| 48 |
pdfauthor={Nicola L.C. Talbot}, |
| 49 |
pdftitle={datetime.sty: A Date and Time Package}, |
| 50 |
pdfkeywords={date,time,LaTeX}]{hyperref} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
\begin{document} |
| 55 |
\DocInput{datetime.dtx} |
| 56 |
\end{document} |
| 57 |
%</driver> |
| 58 |
%\fi |
| 59 |
%\RecordChanges |
| 60 |
%\OnlyDescription |
| 61 |
% |
| 62 |
%\title{datetime.sty v2.60: |
| 63 |
%Formatting Current Date and Time} |
| 64 |
% \author{Nicola L. C. Talbot\\[10pt] |
| 65 |
% Dickimaw Books\\ |
| 66 |
% \url{http://www.dickimaw-books.com/}} |
| 67 |
% \date{2015-03-20} |
| 68 |
% \maketitle |
| 69 |
% |
| 70 |
%\begin{important} |
| 71 |
%This is the last version of this package. The replacement package is |
| 72 |
%called \sty{datetime2} and will be released shortly after the |
| 73 |
%this final version. |
| 74 |
%\end{important} |
| 75 |
% |
| 76 |
% \tableofcontents |
| 77 |
% |
| 78 |
% \section{Introduction} |
| 79 |
%\changes{1.0}{2000/08/08}{First release} |
| 80 |
%\changes{1.01}{2000/09/18}{Documentation added} |
| 81 |
%The \styfmt{datetime} package is a \LaTeXe\ package that |
| 82 |
%provides various different formats for \ics{today}, |
| 83 |
%and provides commands for displaying the current time. |
| 84 |
%If you only want the |
| 85 |
%time commands but not the date changing commands, you can pass |
| 86 |
%the option \pkgopt{nodate} to the package. |
| 87 |
%\changes{2.3}{2004/05/01}{nodate package option added} |
| 88 |
% |
| 89 |
%\changes{2.41}{2004/10/22}{split package into two files: |
| 90 |
%datetime.sty and fmtcount.sty} |
| 91 |
%Since version 2.4, the \styfmt{datetime} package has been |
| 92 |
%separated into two packages: \styfmt{datetime} and |
| 93 |
%\sty{fmtcount}. When I originally created this package, |
| 94 |
%I defined the commands, \ics{ordinal} etc which could be used |
| 95 |
%in the definition of \cs{today}. Since then, I have extended |
| 96 |
%the number of commands available that can be used to display the |
| 97 |
%value of a \LaTeX\ counter, however it seems more appropriate to |
| 98 |
%define all these counter-related commands in a separate package. |
| 99 |
%The \sty{fmtcount} package is now distributed separately |
| 100 |
%from the \styfmt{datetime} package, and will also need to |
| 101 |
%be installed. |
| 102 |
% |
| 103 |
%\changes{2.42}{2004/11/01}{made package compatible with babel} |
| 104 |
%As from version 2.42, the \styfmt{datetime} package is now |
| 105 |
%compatible with \sty{babel}, however you must load the |
| 106 |
%\styfmt{datetime} package \emph{after} the \sty{babel} package. |
| 107 |
%For example: |
| 108 |
%\begin{verbatim} |
| 109 |
%\usepackage[francais]{babel} |
| 110 |
%\usepackage{datetime} |
| 111 |
%\end{verbatim} |
| 112 |
% |
| 113 |
% \section{Predefined Date Formats} |
| 114 |
% There are various declarations that change the effect of |
| 115 |
%\ics{today}. The change can be localised by placing the |
| 116 |
%declaration within a group. |
| 117 |
% |
| 118 |
%As from version 2.43, the numerical date formats (such as |
| 119 |
%\ics{ddmmyyyydate}) use the command |
| 120 |
%\begin{definition}[\DescribeMacro{\dateseparator}] |
| 121 |
%\cs{dateseparator} |
| 122 |
%\end{definition} |
| 123 |
%to separate the numbers. So, for example, if you want to hyphens |
| 124 |
%instead of slashes, you can do: |
| 125 |
%\begin{verbatim} |
| 126 |
%\renewcommand{\dateseparator}{-} |
| 127 |
%\end{verbatim} |
| 128 |
% |
| 129 |
%\subsection{ISO format} |
| 130 |
% |
| 131 |
%\begin{definition}[\DescribeMacro{\yyyymmdddate}] |
| 132 |
%\cs{yyyymmdddate} |
| 133 |
%\end{definition} |
| 134 |
%This declaration will redefine \ics{today} to produce the current |
| 135 |
%date displayed in the form 2000/03/08. (You can redefine |
| 136 |
%\ics{dateseparator} to \texttt{-} to change to 2000-03-08.) |
| 137 |
% |
| 138 |
%\subsection{\texorpdfstring{\meta{Day} \meta{Month} \meta{Year}}{Day Month Year} formats} |
| 139 |
% |
| 140 |
%\begin{definition}[\DescribeMacro{\longdate}] |
| 141 |
%\cs{longdate} |
| 142 |
%\end{definition} |
| 143 |
%This declaration will redefine \ics{today} to produce the current |
| 144 |
%date displayed in the form Wednesday 8\textsuperscript{th} March, |
| 145 |
%2000 if the package option \pkgopt{dayofweek} is used, or |
| 146 |
%8\textsuperscript{th} March, 2000 if the package option |
| 147 |
%\pkgopt{nodayofweek} is used. |
| 148 |
% |
| 149 |
%\begin{definition}[\DescribeMacro{\shortdate}] |
| 150 |
%\cs{shortdate} |
| 151 |
%\end{definition} |
| 152 |
%This declaration will redefine \ics{today} to produce the current |
| 153 |
%date displayed in the form Wed 8\textsuperscript{th} Mar, 2000 if |
| 154 |
%the package option \pkgopt{dayofweek} is used, or |
| 155 |
%8\textsuperscript{th} Mar, 2000 if the package option |
| 156 |
%\pkgopt{nodayofweek} is used. |
| 157 |
% |
| 158 |
%\begin{definition}[\DescribeMacro{\ddmmyyyydate}] |
| 159 |
%\cs{ddmmyyyydate} |
| 160 |
%\end{definition} |
| 161 |
%This declaration will redefine \ics{today} to produce the current |
| 162 |
%date displayed in the form 08/03/2000. |
| 163 |
% |
| 164 |
%\begin{definition}[\DescribeMacro{\dmyyyydate}] |
| 165 |
%\cs{dmyyyydate} |
| 166 |
%\end{definition} |
| 167 |
%This declaration will redefine \ics{today} to produce the current |
| 168 |
%date displayed in the form 8/3/2000. |
| 169 |
% |
| 170 |
%\begin{definition}[\DescribeMacro{\ddmmyydate}] |
| 171 |
%\cs{ddmmyydate} |
| 172 |
%\end{definition} |
| 173 |
%This declaration will redefine \ics{today} to produce the current |
| 174 |
%date displayed in the form 08/03/00. |
| 175 |
% |
| 176 |
%\begin{definition}[\DescribeMacro{\dmyydate}] |
| 177 |
%\cs{dmyydate} |
| 178 |
%\end{definition} |
| 179 |
%This declaration will redefine \ics{today} to produce the current |
| 180 |
%date displayed in the form 8/3/00. |
| 181 |
% |
| 182 |
%\begin{definition}[\DescribeMacro{\textdate}] |
| 183 |
%\cs{textdate} |
| 184 |
%\end{definition} |
| 185 |
%This declaration will redefine \ics{today} to produce the current |
| 186 |
%date displayed in the form: Wednesday the Eighth of March, Two |
| 187 |
%Thousand if the package option \pkgopt{dayofweek} is used, or Eighth |
| 188 |
%of March, Two Thousand if the package option \pkgopt{nodayofweek} is |
| 189 |
%used. Note that \cs{textdate} is defined for use with English, it |
| 190 |
%won't look right if it is used when another language has been |
| 191 |
%selected\footnote{in fact, you may get an error from the |
| 192 |
%\sty{fmtcount} package if you are using a language that it doesn't |
| 193 |
%support.}. If you want to define a similar command for another |
| 194 |
%language, you will first need to check that the \sty{fmtcount} |
| 195 |
%package supports that language. |
| 196 |
% |
| 197 |
%\subsection{\texorpdfstring{\meta{Month} \meta{Day} \meta{Year}}{Month Day Year} formats} |
| 198 |
% |
| 199 |
%\begin{definition}[\DescribeMacro{\usdate}] |
| 200 |
%\cs{usdate} |
| 201 |
%\end{definition} |
| 202 |
%This declaration will redefine \cs{today} to produce the current |
| 203 |
%date displayed in the form March 8, 2000. (As \TeX\ and \LaTeX\ do |
| 204 |
%by default.) |
| 205 |
% |
| 206 |
%\begin{definition}[\DescribeMacro{\mmddyyyydate}] |
| 207 |
%\cs{mmddyyyydate} |
| 208 |
%\end{definition} |
| 209 |
%This declaration will redefine \ics{today} to produce the current |
| 210 |
%date displayed in the form 03/08/2000. |
| 211 |
% |
| 212 |
%\begin{definition}[\DescribeMacro{\mdyyyydate}] |
| 213 |
%\cs{mdyyyydate} |
| 214 |
%\end{definition} |
| 215 |
%This declaration will redefine \verb"\today" to produce the current |
| 216 |
%date displayed in the form 3/8/2000. |
| 217 |
% |
| 218 |
%\begin{definition}[\DescribeMacro{\mmddyydate}] |
| 219 |
%\cs{mmddyydate} |
| 220 |
%\end{definition} |
| 221 |
%This declaration will redefine \ics{today} to produce the current |
| 222 |
%date displayed in the form 03/08/00. |
| 223 |
% |
| 224 |
%\begin{definition}[\DescribeMacro{\mdyydate}] |
| 225 |
%\cs{mdyydate} |
| 226 |
%\end{definition} |
| 227 |
%This declaration will redefine \ics{today} to produce the current |
| 228 |
%date displayed in the form 3/8/00. |
| 229 |
% |
| 230 |
%\subsection{Dates defined by \texorpdfstring{\styfmt{babel}}{babel}} |
| 231 |
% |
| 232 |
%In addition to the above, the declarations \cs{date}\meta{lang} are |
| 233 |
%available for all languages defined either by calling \sty{babel} |
| 234 |
%prior to \styfmt{datetime} or by passing the language name as an |
| 235 |
%option to \styfmt{datetime}. See~\sectionref{sec:newdate} if you |
| 236 |
%want to define your own customised date format. |
| 237 |
% |
| 238 |
% \section{Time Commands} |
| 239 |
% |
| 240 |
%The current time is displayed using the command |
| 241 |
%\begin{definition}[\DescribeMacro{\currenttime}] |
| 242 |
%\cs{currenttime} |
| 243 |
%\end{definition} |
| 244 |
% |
| 245 |
%A specific time can be displayed using the command |
| 246 |
%\begin{definition}[\DescribeMacro{\formattime}] |
| 247 |
%\cs{formattime}\marg{hour}\marg{minute}\marg{second} |
| 248 |
%\end{definition} |
| 249 |
%where \meta{hour} is a number from~0 to~23, and \meta{minute} and |
| 250 |
%\meta{second} are numbers from~0 to~59. |
| 251 |
% |
| 252 |
%The format can be changed using the declaration |
| 253 |
%\begin{definition}[\DescribeMacro{\settimeformat}] |
| 254 |
%\cs{settimeformat}\marg{style} |
| 255 |
%\end{definition} |
| 256 |
%where \meta{style} is the name of the |
| 257 |
%format. Predefined formats are: |
| 258 |
%\begin{description} |
| 259 |
%\item[xxivtime] Twenty-four hour time in the form 22:28 (Default) |
| 260 |
%\item[hhmmsstime] Twenty-four hour time in the form 22:28:00 |
| 261 |
%\item[ampmtime] Twelve hour time in the form 10:28pm |
| 262 |
%\item[oclock] Displays the current time as a string, e.g.\ |
| 263 |
%Twenty-Eight minutes past Ten in the afternoon. |
| 264 |
%\end{description} |
| 265 |
% |
| 266 |
%New time formats can be defined using the command: |
| 267 |
%\begin{definition}[\DescribeMacro{\newtimeformat}] |
| 268 |
%\cs{newtimeformat}\marg{name}\marg{format} |
| 269 |
%\end{definition} |
| 270 |
%where \meta{name} is the name of the new format (used in |
| 271 |
%\ics{settimeformat}), and \meta{format} is how to format the time. |
| 272 |
%Within \meta{format} you can use the counters \ctr{HOUR} (number |
| 273 |
%of hours after midnight), \ctr{MINUTE} (number of minutes past |
| 274 |
%the hour), \ctr{SECOND} (number of seconds) \ctr{HOURXII} |
| 275 |
%(number of hours after midnight/midday), \ctr{TOHOUR} (the next |
| 276 |
%hour) and \ctr{TOMINUTE} (number of minutes to the next hour), |
| 277 |
%and the corresponding commands: \ics{THEHOUR}, \ics{THEMINUTE}, |
| 278 |
%\ics{THESECOND}, \ics{THEHOURXII}, \ics{THETOHOUR} and |
| 279 |
%\ics{THETOMINUTE}. |
| 280 |
% |
| 281 |
%For example, to define a new time format that uses a dot instead of a |
| 282 |
%colon: |
| 283 |
%\begin{verbatim} |
| 284 |
%\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}} |
| 285 |
%\end{verbatim} |
| 286 |
%You then need to switch to this new format before you can use it: |
| 287 |
%\begin{verbatim} |
| 288 |
%\settimeformat{dottime} |
| 289 |
%\currenttime |
| 290 |
%\end{verbatim} |
| 291 |
% |
| 292 |
%As from version 2.43, if you only want to change the separator, |
| 293 |
%you can simply redefine |
| 294 |
%\begin{definition}[\DescribeMacro{\timeseparator}] |
| 295 |
%\cs{timeseparator} |
| 296 |
%\end{definition} |
| 297 |
%instead of defining a new time format. For example: |
| 298 |
%\begin{verbatim} |
| 299 |
%\renewcommand{\timeseparator}{.} |
| 300 |
%\end{verbatim} |
| 301 |
%The \texttt{xxivtime} format will now work like the \texttt{dottime} |
| 302 |
%format defined above. |
| 303 |
% |
| 304 |
% \section{Formating Dates} |
| 305 |
%\begin{definition}[\DescribeMacro{\pdfdate}] |
| 306 |
%\cs{pdfdate} |
| 307 |
%\end{definition} |
| 308 |
% This command\footnote{thanks to Ulrich Dirr for |
| 309 |
%asking about this} prints the date in the format required for |
| 310 |
% PDF files, e.g.\ if the date is 1 May 2004 and time is |
| 311 |
% 22:02, \verb"\pdfdate" will print 20040501220200. The reason |
| 312 |
%this date format is separate from all the others is because the |
| 313 |
%other form doesn't get properly expanded by PDF\TeX. (This |
| 314 |
%command is defined regardless of whether the package option |
| 315 |
%\texttt{nodate} is called.) |
| 316 |
%Example: |
| 317 |
%\begin{verbatim} |
| 318 |
%\pdfinfo{ |
| 319 |
% /Author (Me) |
| 320 |
% /Title (A Sample Document) |
| 321 |
% /CreationDate (D:20040501215500) |
| 322 |
% /ModDate (D:\pdfdate) |
| 323 |
%} |
| 324 |
%\end{verbatim} |
| 325 |
%\textbf{Note} that PDF\TeX\ introduced the new primitive |
| 326 |
%\cs{pdfcreationdate} in version 1.30.0, so \cs{pdfdate} isn't |
| 327 |
%required with newer versions of PDF\TeX. (\cs{pdfcreationdate} |
| 328 |
%is better than \cs{pdfdate} as it also stores the time zone.) |
| 329 |
% |
| 330 |
% There are two commands that print the name of the current |
| 331 |
% month: |
| 332 |
%\begin{definition}[\DescribeMacro{\monthname}] |
| 333 |
%\cs{monthname}\oarg{num} |
| 334 |
%\end{definition} |
| 335 |
%prints the current month name in full, |
| 336 |
%e.g.\ August, and |
| 337 |
%\begin{definition}[\DescribeMacro{\shortmonthname}] |
| 338 |
%\cs{shortmonthname}\oarg{num} |
| 339 |
%\end{definition} |
| 340 |
%prints the abbreviated month name, e.g.\ Aug. Both \cs{monthname} |
| 341 |
%and \cs{shortmonthname} take an optional argument (a number from 1 |
| 342 |
%to 12) if the name of a specific month is required. For example, |
| 343 |
%\verb"\monthname[6]" will produced the output: June. |
| 344 |
% |
| 345 |
% The day of the week is computed using the algorithm documented at |
| 346 |
% \url{http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm}. |
| 347 |
% This algorithm works for any date between 1\textsuperscript{st} |
| 348 |
%Jan, 1901 and 31\textsuperscript{st} Dec, 2099. |
| 349 |
% The following macros display the day of week for a given date: |
| 350 |
% |
| 351 |
%\begin{definition}[\DescribeMacro{\dayofweekname}] |
| 352 |
%\cs{dayofweekname}\marg{day}\marg{month}\marg{year} |
| 353 |
%\end{definition} |
| 354 |
%prints the day of week for the specified date. For example, |
| 355 |
%\begin{verbatim} |
| 356 |
%\dayofweekname{31}{10}{2002} |
| 357 |
%\end{verbatim} |
| 358 |
%will produce the output: Thursday. |
| 359 |
% |
| 360 |
%\begin{definition}[\DescribeMacro{\shortdayofweekname}] |
| 361 |
%\cs{shortdayofweekname}\meta{day}\marg{month}\marg{year} |
| 362 |
%\end{definition} |
| 363 |
%prints the abbreviated name for the day of week for the specified |
| 364 |
%date. For example |
| 365 |
%\begin{verbatim} |
| 366 |
%\shortdayofweekname{31}{10}{2002} |
| 367 |
%\end{verbatim} |
| 368 |
%will produce the output: Thu. |
| 369 |
% |
| 370 |
%\begin{definition}[\DescribeMacro{\ifshowdow}] |
| 371 |
%\cs{ifshowdow} |
| 372 |
%\end{definition} |
| 373 |
%This \TeX\ conditional can be used to determine whether or not the |
| 374 |
%option \pkgopt{dayofweek} has been passed to the package. For |
| 375 |
%example: |
| 376 |
%\begin{verbatim} |
| 377 |
%\ifshowdow\dayofweekname{31}{10}{2002} \fi |
| 378 |
%\end{verbatim} |
| 379 |
%will only display the day of week if the \pkgopt{dayofweek} option |
| 380 |
%was passed to \styfmt{datetime}. Alternatively, you can use |
| 381 |
%David~Carlisle's \sty{ifthen} package: |
| 382 |
%\begin{verbatim} |
| 383 |
%\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{} |
| 384 |
%\end{verbatim} |
| 385 |
% |
| 386 |
%The command |
| 387 |
%\begin{definition}[\DescribeMacro{\ordinaldate}] |
| 388 |
%\cs{ordinaldate}\marg{number} |
| 389 |
%\end{definition} |
| 390 |
%displays \meta{number} as a date-type ordinal. If the current |
| 391 |
%language is English, this will simply pass the argument to |
| 392 |
%\ics{ordinalnum} (defined in the \sty{fmtcount} package), if the |
| 393 |
%current language is Breton, Welsh or French, a superscript will only |
| 394 |
%be added if \meta{number} is 1, otherwise only \meta{number} will be |
| 395 |
%displayed. |
| 396 |
% |
| 397 |
%The macro\footnote{Note the name change since version 1.1. The |
| 398 |
%command name was changed from \cs{thedate} to \cs{formatdate} to |
| 399 |
%avoid a name clash when using the \sty{seminar} class file.} |
| 400 |
%\begin{definition}[\DescribeMacro{\formatdate}] |
| 401 |
%\cs{formatdate}\marg{day}\marg{month}\marg{year} |
| 402 |
%\end{definition} |
| 403 |
%formats the specified date according to the current format of |
| 404 |
%\ics{today}\footnote{To be more precise, \ics{today} is defined to |
| 405 |
%be \ics{formatdate}\{\cs{day}\}\{\cs{month}\}\{\cs{year}\} where |
| 406 |
%\ics{longdate} etc change the definition of \cs{formatdate}}. |
| 407 |
%(Arguments must all be integers.) For example, in combination with |
| 408 |
%\ics{longdate}, the command |
| 409 |
%\begin{verbatim} |
| 410 |
%\formatdate{27}{9}{2004} |
| 411 |
%\end{verbatim} |
| 412 |
%will produce the output: Monday 27\textsuperscript{th} September, |
| 413 |
%2004. |
| 414 |
% |
| 415 |
%You can ensure that a number is displayed with at least two digits |
| 416 |
%using the command |
| 417 |
%\begin{definition}[\DescribeMacro{\twodigit}] |
| 418 |
%\cs{twodigit}\marg{num} |
| 419 |
%\end{definition} |
| 420 |
% |
| 421 |
%\section{Defining New Date Formats}\label{sec:newdate} |
| 422 |
% |
| 423 |
%New date formats can be defined using the command: |
| 424 |
%\begin{definition}[\DescribeMacro{\newdateformat}] |
| 425 |
% \cs{newdateformat}\marg{name}\marg{format} |
| 426 |
%\end{definition} |
| 427 |
%where \meta{name} is the name of the new format, and \meta{format} |
| 428 |
%is how to format the date. Within the argument \meta{format} you can |
| 429 |
%use the commands \ics{THEDAY}, \ics{THEMONTH} and \ics{THEYEAR} to |
| 430 |
%represent the relevant day, month and year, or you can use the |
| 431 |
%counters \ctr{DAY}, \ctr{MONTH} and \ctr{YEAR} if you want to use |
| 432 |
%\ics{ordinal} etc. Once you have defined the new date format, you |
| 433 |
%can then switch to it using the declaration \verb'\'\meta{name} |
| 434 |
%(i.e.\ the name you specified preceded by a backslash), and |
| 435 |
%subsequent calls to \ics{today} and \ics{formatdate} will use your |
| 436 |
%new format. |
| 437 |
% |
| 438 |
%For example, suppose you want to define a new date format called, |
| 439 |
%say, \texttt{mydate}, that will typeset the date in the form: |
| 440 |
%8-3-2002, then you can do: |
| 441 |
%\begin{verbatim} |
| 442 |
%\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR} |
| 443 |
%\end{verbatim} |
| 444 |
%\ics{newdateformat} will then define the declaration |
| 445 |
%\cs{mydate} which can be used to |
| 446 |
%switch to your new format. In the following example, |
| 447 |
%two new date formats are defined, and they are then |
| 448 |
%selected to produce two different formats for the current date: |
| 449 |
%\begin{verbatim} |
| 450 |
%\newdateformat{dashdate}{% |
| 451 |
%\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR} |
| 452 |
% |
| 453 |
%\newdateformat{usvardate}{% |
| 454 |
%\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR} |
| 455 |
% |
| 456 |
%Dash: \dashdate\today. |
| 457 |
%US: \usvardate\today. |
| 458 |
%\end{verbatim} |
| 459 |
%If the current date is, say, 8th March, 2002, the above code will |
| 460 |
%produce the following: Dash: 08-03-2002. US: March |
| 461 |
%8\textsuperscript{th}, 2002. |
| 462 |
% |
| 463 |
%Note that \ics{THEDAY} etc and \ctr{DAY} etc have no real |
| 464 |
%meaning outside \ics{newdateformat} (this is why they |
| 465 |
%are in uppercase). Incidentally, the \texttt{dashdate} format |
| 466 |
%is not really necessary, as you can achieve this format |
| 467 |
%using: |
| 468 |
%\begin{verbatim} |
| 469 |
%\renewcommand{\dateseparator}{-} |
| 470 |
%\ddmmyyyydate |
| 471 |
%\end{verbatim} |
| 472 |
% |
| 473 |
%Another note: in the above code, \ics{ordinal} was |
| 474 |
%used to illustrate the use of the \ctr{DAY} counter. It |
| 475 |
%is better to use \ics{ordinaldate} instead: |
| 476 |
%\begin{verbatim} |
| 477 |
%\newdateformat{usvardate}{% |
| 478 |
%\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR} |
| 479 |
%\end{verbatim} |
| 480 |
% |
| 481 |
%\section{Saving Dates} |
| 482 |
% |
| 483 |
%It is possible to save a date for later use using the command: |
| 484 |
%\footnote{Thanks to Denis Bitouz\'e for asking about this} |
| 485 |
%\begin{definition}[\DescribeMacro{\newdate}] |
| 486 |
%\cs{newdate}\marg{name}\marg{day}\marg{month}\marg{year} |
| 487 |
%\end{definition} |
| 488 |
% |
| 489 |
%This date can later be displayed using the same format as that |
| 490 |
%used by \ics{formatdate} using the command: |
| 491 |
%\begin{definition}[\DescribeMacro{\displaydate}] |
| 492 |
%\cs{displaydate}\marg{name} |
| 493 |
%\end{definition} |
| 494 |
% |
| 495 |
%Individual elements of the date can be extracted using the |
| 496 |
%commands: |
| 497 |
%\begin{definition}[\DescribeMacro{\getdateday}] |
| 498 |
%\cs{getdateday}\marg{name} |
| 499 |
%\end{definition} |
| 500 |
%\begin{definition}[\DescribeMacro{\getdatemonth}] |
| 501 |
%\cs{getdatemonth}\marg{name} |
| 502 |
%\end{definition} |
| 503 |
%\begin{definition}[\DescribeMacro{\getdateyear}] |
| 504 |
%\cs{getdateyear}\marg{name} |
| 505 |
%\end{definition} |
| 506 |
% |
| 507 |
%\section{Predefined Names} |
| 508 |
% |
| 509 |
%The following commands are defined by the \styfmt{datetime} |
| 510 |
%package: |
| 511 |
% |
| 512 |
%\begin{tabular}{ll} |
| 513 |
%\bfseries Command Name & \bfseries Default Value\\ |
| 514 |
%\ics{dateseparator} & \verb'/'\\ |
| 515 |
%\ics{timeseparator} & \verb':'\\ |
| 516 |
%\ics{amname} & \texttt{am}\\ |
| 517 |
%\ics{pmname} & \texttt{pm}\\ |
| 518 |
%\ics{amorpmname} & \ics{amname} if morning, otherwise \ics{pmname}\\ |
| 519 |
%\ics{amstring} & \texttt{in the morning}\\ |
| 520 |
%\ics{pmstring} & \texttt{in the afternoon}\\ |
| 521 |
%\ics{amorpmstring} & \ics{amstring} if morning, otherwise |
| 522 |
%\ics{pmstring}\\ |
| 523 |
%\ics{halfpast} & \texttt{Half past}\\ |
| 524 |
%\ics{quarterpast} & \texttt{Quarter past}\\ |
| 525 |
%\ics{quarterto} & \texttt{Quarter to}\\ |
| 526 |
%\ics{noon} & \texttt{Noon}\\ |
| 527 |
%\ics{midnight} & \texttt{Midnight}\\ |
| 528 |
%\ics{oclockstring} & \texttt{O'Clock} |
| 529 |
%\end{tabular} |
| 530 |
% |
| 531 |
%\section{Package Options} |
| 532 |
% |
| 533 |
% The following options may be passed to this package: |
| 534 |
%\begin{description} |
| 535 |
%\item[\pkgopt{long}] make \cs{today} produce long date |
| 536 |
%\item[\pkgopt{short}] make \cs{today} produce short date |
| 537 |
%\item[\pkgopt{yyyymmdd}] make \cs{today} produce YYYY/MM/DD date |
| 538 |
%\item[\pkgopt{ddmmyyyy}] make \cs{today} produce DD/MM/YYYY date |
| 539 |
%\item[\pkgopt{dmyyyy}] make \cs{today} produce D/M/YYYY date |
| 540 |
%\item[\pkgopt{ddmmyy}] make \cs{today} produce DD/MM/YY date |
| 541 |
%\item[\pkgopt{dmyy}] make \cs{today} produce D/M/YY date |
| 542 |
%\item[\pkgopt{text}] make \cs{today} produce text date in UK style |
| 543 |
%\item[\pkgopt{us}] make \cs{today} produce US style date |
| 544 |
%\item[\pkgopt{mmddyyyy}] make \cs{today} produce MM/DD/YYYY date |
| 545 |
%\item[\pkgopt{mdyyyy}] make \cs{today} produce M/D/YYYY date |
| 546 |
%\item[\pkgopt{mmddyy}] make \cs{today} produce MM/DD/YY date |
| 547 |
%\item[\pkgopt{mdyy}] make \cs{today} produce M/D/YY date |
| 548 |
%\item[\pkgopt{raise}] make ordinal st,nd,rd,th appear as superscript |
| 549 |
%\item[\pkgopt{level}] make ordinal st,nd,rd,th appear level with rest of |
| 550 |
%text |
| 551 |
%\item[\pkgopt{dayofweek}] make the day of week appear for \ics{longdate}, |
| 552 |
%\ics{shortdate} |
| 553 |
% or \ics{textdate} |
| 554 |
%\item[\pkgopt{nodayofweek}] don't display the day of week. |
| 555 |
%\item[\pkgopt{hhmmss}] make \cs{currenttime} produce \texttt{hhmmsstime} |
| 556 |
%format |
| 557 |
%\item[\pkgopt{24hr}] make \cs{currenttime} produce \texttt{xxivtime} |
| 558 |
%format |
| 559 |
%\item[\pkgopt{12hr}] make \cs{currenttime} produce \texttt{ampmtime} |
| 560 |
%format |
| 561 |
%\item[\pkgopt{oclock}] make \cs{currenttime} produce \texttt{oclock} |
| 562 |
%format |
| 563 |
%\item[\pkgopt{nodate}] Don't redefine \cs{today} or define the month or |
| 564 |
%day of week commands |
| 565 |
% (useful if you only want the time commands) |
| 566 |
%\item[\pkgopt{iso}] as \pkgopt{ddmmyyyy} and \pkgopt{hhmmss} but |
| 567 |
%also sets date separator to \texttt{-} |
| 568 |
% and time separator to \texttt{:} |
| 569 |
% \end{description} |
| 570 |
% |
| 571 |
%The default options are: \pkgopt{long}, \pkgopt{raise}, |
| 572 |
%\pkgopt{dayofweek} and \pkgopt{24hr}. |
| 573 |
% |
| 574 |
%\section{Multilingual Support} |
| 575 |
% |
| 576 |
%If you use the \sty{ngerman} package, you must use \styfmt{datetime}'s |
| 577 |
%\pkgopt{ngerman} package option if you want the date displayed |
| 578 |
%in the same form as \sty{ngerman}. You must also load \sty{ngerman} |
| 579 |
%\emph{before} you load \styfmt{datetime}. Similarly for the |
| 580 |
%\sty{german} package. |
| 581 |
% |
| 582 |
%If you want to use the \sty{babel} package, you must load |
| 583 |
%it \emph{before} you load the \styfmt{datetime} package. This |
| 584 |
%is because the \sty{babel} \cs{date}\meta{lang} commands |
| 585 |
%redefine \ics{today}, whereas the \sty{datetime} package |
| 586 |
%redefines \cs{today} to use \ics{formatdate}, and the |
| 587 |
%date formatting commands (such as \ics{longdate}) redefine |
| 588 |
%\cs{formatdate} rather than \cs{today}. This ensures |
| 589 |
%consistent formatting of the dates whether you use \cs{today} or |
| 590 |
%\cs{formatdate}. Therefore, the \styfmt{datetime} package |
| 591 |
%has to redefine all the \cs{date}\meta{lang} commands accordingly. |
| 592 |
%Thus the multilingual date support is mostly limited to that provided |
| 593 |
%by \sty{babel}. Additional support, such as the day of |
| 594 |
%week names and abbreviations, are only supplied for those |
| 595 |
%languages that I know, or that other people have been able to supply |
| 596 |
%for me. |
| 597 |
% |
| 598 |
%As from v2.56, the package options supplied to \styfmt{datetime} |
| 599 |
%override \sty{babel}'s date format. For example: |
| 600 |
%\begin{verbatim} |
| 601 |
%\usepackage[french,spanish]{babel} |
| 602 |
%\usepackage[ddmmyyyy]{datetime} |
| 603 |
%\end{verbatim} |
| 604 |
%will use ddmmyyyy date format regardless of language. Note that |
| 605 |
%if you use a declaration instead of a package option, for |
| 606 |
%example: |
| 607 |
%\begin{verbatim} |
| 608 |
%\usepackage[french,spanish]{babel} |
| 609 |
%\usepackage{datetime} |
| 610 |
%\ddmmyyyydate |
| 611 |
%\end{verbatim} |
| 612 |
%the date format will be switched back to \cs{datefrench} or |
| 613 |
%\cs{datespanish} whenever the language is set. You can use |
| 614 |
%\begin{definition}[\DescribeMacro{\setdefaultdate}] |
| 615 |
%\cs{setdefaultdate}\marg{declaration} |
| 616 |
%\end{definition} |
| 617 |
%to always use \marg{declaration} whenever the language |
| 618 |
%is set. For example: |
| 619 |
%\begin{verbatim} |
| 620 |
%\setdefaultdate{\ddmmyyyydate} |
| 621 |
%\end{verbatim} |
| 622 |
% |
| 623 |
%The commands \ics{monthname} and \ics{shortmonthname}, |
| 624 |
%will produce the month name in the current language. |
| 625 |
%If you want the month name in a specific language, you |
| 626 |
%can use the command \cs{monthname}\meta{lang}. |
| 627 |
%For example, \verb"\monthnamefrench[6]" will produce the output: |
| 628 |
%juin. Note that \ics{textdate} is formatted for English dates, |
| 629 |
%and won't look right if used with another language setting. If you |
| 630 |
%want a textual date, the \sty{fmtcount} package (which is |
| 631 |
%loaded by \styfmt{datetime}) defines some commands which display |
| 632 |
%a number or ordinal as a word, but it only has very limited |
| 633 |
%multilingual support. See the \sty{fmtcount} documentation |
| 634 |
%for further details. |
| 635 |
% |
| 636 |
%\section{Registers} |
| 637 |
% |
| 638 |
%\TeX\ provides \ics{day}, \ics{month} and \ics{year} registers. In |
| 639 |
%addition, \styfmt{datetime} provides the registers: |
| 640 |
%\ics{currenthour}, \ics{currentminute} and \ics{currentsecond}. |
| 641 |
%Note that old distributions of \TeX\ will always have |
| 642 |
%\cs{currentsecond} set to zero. |
| 643 |
% |
| 644 |
%\section{Configuration File} |
| 645 |
% |
| 646 |
%As from Version 2.4, the \styfmt{datetime} package will read in settings |
| 647 |
%from the configuration file \texttt{datetime.cfg}, if it exists, |
| 648 |
%which will override the default package options. For example, |
| 649 |
%suppose you prefer a short date without the day of week by default, |
| 650 |
%you will need to create a file called \texttt{datetime.cfg} that |
| 651 |
%contains the line: |
| 652 |
%\begin{verbatim} |
| 653 |
%\shortdate\showdowfalse |
| 654 |
%\end{verbatim} |
| 655 |
%The file \texttt{datetime.cfg} should then go somewhere on the |
| 656 |
%\TeX\ path. Now all you need to do is: |
| 657 |
%\begin{verbatim} |
| 658 |
%\usepackage{datetime} |
| 659 |
%\end{verbatim} |
| 660 |
%without having to specify the \pkgopt{short} and |
| 661 |
%\pkgopt{nodayofweek} options. |
| 662 |
% |
| 663 |
%You can also use this file to define and set your own date |
| 664 |
%styles. For example, you could create |
| 665 |
%a configuration file that has the following lines: |
| 666 |
%\begin{verbatim} |
| 667 |
%\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR} |
| 668 |
%\dashdate |
| 669 |
%\end{verbatim} |
| 670 |
%Whenever you use the \styfmt{datetime} package, it will now |
| 671 |
%use this format by default. |
| 672 |
% |
| 673 |
%\section{LaTeX2HTML styles} |
| 674 |
% |
| 675 |
%\changes{2.43}{2005/02/25}{Added LaTeX2HTML support}% |
| 676 |
%\changes{2.44}{2005/03/03}{Fixed minor bugs in Perl scripts} |
| 677 |
%Version 2.43 and above of the \styfmt{datetime} bundle |
| 678 |
%supplies the LaTeX2HTML style file \texttt{datetime.perl}. |
| 679 |
%This file should be placed in a |
| 680 |
%directory searched by LaTeX2HTML. The following limitations |
| 681 |
%apply to the LaTeX2HTML styles: |
| 682 |
% |
| 683 |
%\begin{itemize} |
| 684 |
%\item The configuration file \texttt{datetime.cfg} |
| 685 |
%is currently ignored. You can however |
| 686 |
%do: |
| 687 |
%\begin{verbatim} |
| 688 |
%\usepackage{datetime} |
| 689 |
%\html{\input{datetime.cfg}} |
| 690 |
%\end{verbatim} |
| 691 |
%This, I agree, is an unpleasant cludge. |
| 692 |
% |
| 693 |
%\item The commands \cs{monthname}\meta{language} are not |
| 694 |
%implemented. |
| 695 |
% |
| 696 |
%\item Some of the languages are not implemented. |
| 697 |
% |
| 698 |
%\item The package option \pkgopt{nodate} is not implemented. |
| 699 |
% |
| 700 |
%\end{itemize} |
| 701 |
% |
| 702 |
%\section{Troubleshooting} |
| 703 |
% |
| 704 |
%There is a \sty{datetime} FAQ available at: |
| 705 |
%\url{http://www.dickimaw-books.com/faqs/datetimefaq.html}. |
| 706 |
% |
| 707 |
%\StopEventually{\phantomsection |
| 708 |
%\addcontentsline{toc}{section}{Index}\PrintIndex |
| 709 |
%} |
| 710 |
% |
| 711 |
% |
| 712 |
% |
| 713 |
%\section{The Code} |
| 714 |
%\iffalse |
| 715 |
% \begin{macrocode} |
| 716 |
%<*datetime-defaults.sty> |
| 717 |
% \end{macrocode} |
| 718 |
%\fi |
| 719 |
% Default language settings. |
| 720 |
% \begin{macrocode} |
| 721 |
\ProvidesPackage{datetime-defaults}[2013/09/10] |
| 722 |
% \end{macrocode} |
| 723 |
%\begin{macro}{\ordinaldateenglish} |
| 724 |
% Default date ordinal: |
| 725 |
% \begin{macrocode} |
| 726 |
\newcommand*{\ordinaldateenglish}[1]{\ordinalnum{#1}} |
| 727 |
% \end{macrocode} |
| 728 |
%\end{macro} |
| 729 |
%\begin{macro}{\monthnameenglish} |
| 730 |
% \begin{macrocode} |
| 731 |
\providecommand*{\monthnameenglish}[1][\month]{% |
| 732 |
\@orgargctr=#1\relax |
| 733 |
\ifcase\@orgargctr |
| 734 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month |
| 735 |
numbers should go from 1 (January) to 12 (December)}% |
| 736 |
\or January% |
| 737 |
\or February% |
| 738 |
\or March% |
| 739 |
\or April% |
| 740 |
\or May% |
| 741 |
\or June% |
| 742 |
\or July% |
| 743 |
\or August% |
| 744 |
\or September% |
| 745 |
\or October% |
| 746 |
\or November% |
| 747 |
\or December% |
| 748 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 749 |
Month numbers should go from 1 (January) to 12 (December)}% |
| 750 |
\fi |
| 751 |
} |
| 752 |
% \end{macrocode} |
| 753 |
%\end{macro} |
| 754 |
%\begin{macro}{\shortmonthnameenglish} |
| 755 |
%\changes{2.1}{2003/12/17}{fixed bug producing an error message |
| 756 |
% in December} |
| 757 |
% \begin{macrocode} |
| 758 |
\providecommand*{\shortmonthnameenglish}[1][\month]{% |
| 759 |
\@orgargctr=#1\relax |
| 760 |
\ifcase\@orgargctr |
| 761 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month |
| 762 |
numbers should go from 1 (jan) to 12 (dec)}% |
| 763 |
\or Jan% |
| 764 |
\or Feb% |
| 765 |
\or Mar% |
| 766 |
\or Apr% |
| 767 |
\or May% |
| 768 |
\or Jun% |
| 769 |
\or Jul% |
| 770 |
\or Aug% |
| 771 |
\or Sept% |
| 772 |
\or Oct% |
| 773 |
\or Nov% |
| 774 |
\or Dec% |
| 775 |
\else% |
| 776 |
\PackageError{datetime}% |
| 777 |
{Invalid Month number \the\@orgargctr}% |
| 778 |
{Month numbers should go from 1 (jan) to 12 (dec)}% |
| 779 |
\fi |
| 780 |
} |
| 781 |
% \end{macrocode} |
| 782 |
%\end{macro} |
| 783 |
%\begin{macro}{\dayofweeknameidenglish} |
| 784 |
% Given the day of week index, print associated the English name. |
| 785 |
% \begin{macrocode} |
| 786 |
\providecommand*{\dayofweeknameidenglish}[1]{% |
| 787 |
\ifcase#1\relax |
| 788 |
\or Sunday% |
| 789 |
\or Monday% |
| 790 |
\or Tuesday% |
| 791 |
\or Wednesday% |
| 792 |
\or Thursday% |
| 793 |
\or Friday% |
| 794 |
\or Saturday% |
| 795 |
\fi |
| 796 |
} |
| 797 |
% \end{macrocode} |
| 798 |
%\end{macro} |
| 799 |
%\begin{macro}{\shortdayofweeknameidenglish} |
| 800 |
% As before, but for abbreviated day of week name. English version: |
| 801 |
% \begin{macrocode} |
| 802 |
\providecommand*{\shortdayofweeknameidenglish}[1]{% |
| 803 |
\ifcase#1\relax |
| 804 |
\or Sun% |
| 805 |
\or Mon% |
| 806 |
\or Tue% |
| 807 |
\or Wed% |
| 808 |
\or Thu% |
| 809 |
\or Fri% |
| 810 |
\or Sat% |
| 811 |
\fi} |
| 812 |
% \end{macrocode} |
| 813 |
%\end{macro} |
| 814 |
%\iffalse |
| 815 |
% \begin{macrocode} |
| 816 |
%</datetime-defaults.sty> |
| 817 |
% \end{macrocode} |
| 818 |
%\fi |
| 819 |
%\iffalse |
| 820 |
% \begin{macrocode} |
| 821 |
%<*datetime.sty> |
| 822 |
% \end{macrocode} |
| 823 |
%\fi |
| 824 |
%\subsection{datetime.sty} |
| 825 |
% This section documents the code for \texttt{datetime.sty} |
| 826 |
% \begin{macrocode} |
| 827 |
\NeedsTeXFormat{LaTeX2e} |
| 828 |
\ProvidesPackage{datetime}[2015/03/20 v2.60 Date Time Package] |
| 829 |
% \end{macrocode} |
| 830 |
%\changes{2.59}{2013/09/10}{new loads etoolbox} |
| 831 |
% \begin{macrocode} |
| 832 |
\RequirePackage{etoolbox} |
| 833 |
% \end{macrocode} |
| 834 |
%\texttt{fmtcount.sty} needs to be loaded here as it defines the |
| 835 |
% command \cs{fmtord} which may be redefined later: |
| 836 |
% \begin{macrocode} |
| 837 |
\RequirePackage{fmtcount} |
| 838 |
% \end{macrocode} |
| 839 |
% In case we're using an older version of \sty{fmtcount}: |
| 840 |
% \begin{macrocode} |
| 841 |
\@ifundefined{@FCmodulo}% |
| 842 |
{% |
| 843 |
\let\@FCmodulo\@modulo |
| 844 |
}{} |
| 845 |
% \end{macrocode} |
| 846 |
% Need ifthen package for conditional stuff. |
| 847 |
% \begin{macrocode} |
| 848 |
\RequirePackage{ifthen} |
| 849 |
% \end{macrocode} |
| 850 |
%\subsubsection{Date Commands} |
| 851 |
% Load defaults: |
| 852 |
% \begin{macrocode} |
| 853 |
\RequirePackage{datetime-defaults} |
| 854 |
% \end{macrocode} |
| 855 |
%\begin{macro}{\if@dtl@nodate} |
| 856 |
% Define a new conditional \cs{if@dt@nodate}. If it is true, |
| 857 |
% \cs{today} will not be redefined, nor will |
| 858 |
% \cs{monthname}, \cs{shortmonthname}, \cs{dayofweek} and |
| 859 |
% \cs{shortdayofweek} be defined. |
| 860 |
% Set it to false. |
| 861 |
% \begin{macrocode} |
| 862 |
\newif\if@dt@nodate |
| 863 |
\@dt@nodatefalse |
| 864 |
% \end{macrocode} |
| 865 |
%\end{macro} |
| 866 |
%\begin{macro}{\dateseparator} |
| 867 |
% Define the character used to separate the numbers in the formats |
| 868 |
% defined by \cs{ddmmyyyy} etc |
| 869 |
%\changes{2.43}{2005/02/25}{new} |
| 870 |
% \begin{macrocode} |
| 871 |
\newcommand{\dateseparator}{/} |
| 872 |
% \end{macrocode} |
| 873 |
%\end{macro} |
| 874 |
%\begin{macro}{\if@dt@multilingual} |
| 875 |
% Define switch to determine whether to enable multilingual support. |
| 876 |
% This check to see if babel package is |
| 877 |
% loaded instead of testing 'languagename (following suggestions on |
| 878 |
% comp.text.tex) |
| 879 |
%\changes{v2.49}{5 Dec 2006}{checks if babel package has been loaded} |
| 880 |
% Note that babel must be loaded \emph{before} datetime, otherwise |
| 881 |
% it will change the definitions of \cs{date}\meta{lang}. |
| 882 |
%\changes{2.55}{2007/08/20}{fixed bug preventing multilingual support} |
| 883 |
% \begin{macrocode} |
| 884 |
\newif\if@dt@multilingual |
| 885 |
\@ifpackageloaded{babel}% |
| 886 |
{% |
| 887 |
\@dt@multilingualtrue |
| 888 |
}% |
| 889 |
{% |
| 890 |
\@ifpackageloaded{ngerman}% |
| 891 |
{\@dt@multilingualtrue}% |
| 892 |
{\@dt@multilingualfalse}% |
| 893 |
} |
| 894 |
% \end{macrocode} |
| 895 |
%\end{macro} |
| 896 |
% Define the \cs{ordinaldate}\meta{language} macros. These are |
| 897 |
% needed because some |
| 898 |
% languages only use an ordinal for the first day of |
| 899 |
% the month (such as french). |
| 900 |
% If |\ordinaldate|\meta{language} is not defined, then just display |
| 901 |
% the number. |
| 902 |
%\changes{2.45}{2005/05/23}{new} |
| 903 |
%\changes{2.59}{2013/09/10}{made robust} |
| 904 |
% \begin{macrocode} |
| 905 |
\DeclareRobustCommand*{\ordinaldate}[1]{% |
| 906 |
\if@dt@multilingual |
| 907 |
% \end{macrocode} |
| 908 |
% Make sure language file has been loaded. |
| 909 |
% \begin{macrocode} |
| 910 |
\DTloadDefIfNotLoadedButExists{\languagename}% |
| 911 |
\@ifundefined{ordinaldate\languagename}{#1}% |
| 912 |
{% |
| 913 |
\csname ordinaldate\languagename\endcsname{#1}% |
| 914 |
}% |
| 915 |
\else |
| 916 |
\ordinalnum{#1}% |
| 917 |
\fi |
| 918 |
} |
| 919 |
% \end{macrocode} |
| 920 |
%\end{macro} |
| 921 |
%\begin{macro}{\ifshowdow} |
| 922 |
% Now define the declarations that redefine |\formatdate| as they |
| 923 |
% are used by the package options. Need a conditional to determine |
| 924 |
% whether or not to show the day of week name. |
| 925 |
% \begin{macrocode} |
| 926 |
\newif\ifshowdow |
| 927 |
% \end{macrocode} |
| 928 |
%\end{macro} |
| 929 |
%\changes{1.1}{2002/04/20}{\cs{thedate} added} |
| 930 |
%\begin{macro}{\formatdate} |
| 931 |
% Initially |\formatdate| does nothing. It will be redefined later. |
| 932 |
%\changes{2.0}{2002/10/30}{changes \cs{thedate} to \cs{formatdate} |
| 933 |
% to avoid name conflict with other packages/class files.} |
| 934 |
% \begin{macrocode} |
| 935 |
\providecommand*{\formatdate}[3]{} |
| 936 |
% \end{macrocode} |
| 937 |
%\end{macro} |
| 938 |
% Provide counters to store the specified date: |
| 939 |
% \begin{macrocode} |
| 940 |
\newcount\@day |
| 941 |
\newcount\@month |
| 942 |
\newcount\@year |
| 943 |
% \end{macrocode} |
| 944 |
%\begin{macro}{\longdate} |
| 945 |
% Long date format. (This is the default in the absence of package |
| 946 |
% options, babel and datetime.cfg settings.) |
| 947 |
% \begin{macrocode} |
| 948 |
\DeclareRobustCommand*{\longdate}{% |
| 949 |
\renewcommand*{\formatdate}[3]{% |
| 950 |
\ifshowdow\dayofweekname{##1}{##2}{##3} \fi |
| 951 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 952 |
\ordinaldate{\the\@day}\ \monthname[\@month], \the\@year}% |
| 953 |
} |
| 954 |
% \end{macrocode} |
| 955 |
%\end{macro} |
| 956 |
%\begin{macro}{\shortdate} |
| 957 |
% Abbreviated version of above |
| 958 |
% \begin{macrocode} |
| 959 |
\DeclareRobustCommand*{\shortdate}{% |
| 960 |
\renewcommand*{\formatdate}[3]{% |
| 961 |
\ifshowdow\shortdayofweekname{##1}{##2}{##3} \fi |
| 962 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 963 |
\ordinaldate{\the\@day}\ \shortmonthname[\@month], \the\@year}% |
| 964 |
} |
| 965 |
% \end{macrocode} |
| 966 |
%\end{macro} |
| 967 |
%\begin{macro}{\twodigit} |
| 968 |
% Define |\twodigit| to display a number as two digits. \LaTeX\ |
| 969 |
% already defines the internal command |\two@digits|, but need |
| 970 |
% a command that can be used in |\newdateformat| in the document. |
| 971 |
%\changes{2.2}{2004/04/27}{new} |
| 972 |
% \begin{macrocode} |
| 973 |
\let\twodigit\two@digits |
| 974 |
% \end{macrocode} |
| 975 |
%\end{macro} |
| 976 |
%\begin{macro}{\yyyymmdddate} |
| 977 |
%\changes{2.56}{2009/11/16}{new} |
| 978 |
% Year/month/day format. (Day and month displayed as two digits, |
| 979 |
% year displayed as is.) |
| 980 |
% \begin{macrocode} |
| 981 |
\DeclareRobustCommand*{\yyyymmdddate}{% |
| 982 |
\renewcommand*{\formatdate}[3]{% |
| 983 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 984 |
\the\@year\dateseparator \twodigit\@month\dateseparator |
| 985 |
\twodigit\@day}} |
| 986 |
% \end{macrocode} |
| 987 |
%\end{macro} |
| 988 |
%\begin{macro}{\ddmmyyyydate} |
| 989 |
% Day/month/year format. (Day and month displayed as two digits, |
| 990 |
% year displayed as is.) |
| 991 |
% \begin{macrocode} |
| 992 |
\DeclareRobustCommand*{\ddmmyyyydate}{% |
| 993 |
\renewcommand*{\formatdate}[3]{% |
| 994 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 995 |
\twodigit\@day\dateseparator \twodigit\@month\dateseparator |
| 996 |
\the\@year}} |
| 997 |
% \end{macrocode} |
| 998 |
%\end{macro} |
| 999 |
%\begin{macro}{\dmyyyydate} |
| 1000 |
% Day/month/year format. (Numbers all displayed as is.) |
| 1001 |
% \begin{macrocode} |
| 1002 |
\DeclareRobustCommand*{\dmyyyydate}{% |
| 1003 |
\renewcommand*{\formatdate}[3]{% |
| 1004 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1005 |
\the\@day\dateseparator \the\@month\dateseparator \the\@year}} |
| 1006 |
% \end{macrocode} |
| 1007 |
%\end{macro} |
| 1008 |
%\begin{macro}{\ddmmyydate} |
| 1009 |
% Day/month/year format. (All numbers displayed as two digits.) |
| 1010 |
% \begin{macrocode} |
| 1011 |
\DeclareRobustCommand*{\ddmmyydate}{\renewcommand*{\formatdate}[3]{% |
| 1012 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1013 |
\@dtctr=\@year% |
| 1014 |
\@FCmodulo{\@dtctr}{100}% |
| 1015 |
\twodigit\@day\dateseparator \twodigit\@month\dateseparator |
| 1016 |
\twodigit\@dtctr}} |
| 1017 |
% \end{macrocode} |
| 1018 |
%\end{macro} |
| 1019 |
%\begin{macro}{\dmyydate} |
| 1020 |
% Day/month/year format. (Day and month displayed as is, year |
| 1021 |
% abbreviated to two digits.) |
| 1022 |
% \begin{macrocode} |
| 1023 |
\DeclareRobustCommand*{\dmyydate}{\renewcommand*{\formatdate}[3]{% |
| 1024 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1025 |
\@dtctr=\@year% |
| 1026 |
\@FCmodulo{\@dtctr}{100}% |
| 1027 |
\the\@day\dateseparator \the\@month\dateseparator \twodigit\@dtctr}} |
| 1028 |
% \end{macrocode} |
| 1029 |
%\end{macro} |
| 1030 |
%\begin{macro}{\textdate} |
| 1031 |
% Full textual date (English). |
| 1032 |
% \begin{macrocode} |
| 1033 |
\DeclareRobustCommand*{\textdate}{% |
| 1034 |
\renewcommand*{\formatdate}[3]{% |
| 1035 |
\ifshowdow\dayofweekname{##1}{##2}{##3} the \fi |
| 1036 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1037 |
\Ordinalstringnum{\@day}\ of \monthname[\@month], |
| 1038 |
\Numberstringnum{\@year}% |
| 1039 |
}} |
| 1040 |
% \end{macrocode} |
| 1041 |
%\end{macro} |
| 1042 |
%\begin{macro}{\usdate} |
| 1043 |
% US format (as per original definition of |\today|) |
| 1044 |
% \begin{macrocode} |
| 1045 |
\DeclareRobustCommand*{\usdate}{% |
| 1046 |
\renewcommand*{\formatdate}[3]{% |
| 1047 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1048 |
\monthname[\@month]\ \the\@day, \the\@year}} |
| 1049 |
% \end{macrocode} |
| 1050 |
%\end{macro} |
| 1051 |
%\begin{macro}{\mmddyyyydate} |
| 1052 |
% Month/day/year format. (Month and day displayed as two digits, |
| 1053 |
% year displayed as is.) |
| 1054 |
% \begin{macrocode} |
| 1055 |
\DeclareRobustCommand*{\mmddyyyydate}{% |
| 1056 |
\renewcommand*{\formatdate}[3]{% |
| 1057 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1058 |
\twodigit\@month\dateseparator \twodigit\@day\dateseparator |
| 1059 |
\the\@year}} |
| 1060 |
% \end{macrocode} |
| 1061 |
%\end{macro} |
| 1062 |
%\begin{macro}{\mdyyyydate} |
| 1063 |
% Month/day/year format. (All numbers displayed as is.) |
| 1064 |
% \begin{macrocode} |
| 1065 |
\DeclareRobustCommand*{\mdyyyydate}{% |
| 1066 |
\renewcommand*{\formatdate}[3]{% |
| 1067 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1068 |
\the\@month\dateseparator \the\@day\dateseparator \the\@year}} |
| 1069 |
% \end{macrocode} |
| 1070 |
%\end{macro} |
| 1071 |
%\begin{macro}{\mmddyydate} |
| 1072 |
% Month/day/year format. (All numbers displayed with two digits.) |
| 1073 |
% \begin{macrocode} |
| 1074 |
\DeclareRobustCommand*{\mmddyydate}{\renewcommand*{\formatdate}[3]{% |
| 1075 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1076 |
\@dtctr=\@year% |
| 1077 |
\@FCmodulo{\@dtctr}{100}% |
| 1078 |
\twodigit\@month\dateseparator \twodigit\@day\dateseparator |
| 1079 |
\twodigit\@dtctr}} |
| 1080 |
% \end{macrocode} |
| 1081 |
%\end{macro} |
| 1082 |
%\begin{macro}{\mdyydate} |
| 1083 |
% Month/day/year format. (Month and day displayed as is, year |
| 1084 |
% abbreviated to two digits.) |
| 1085 |
% \begin{macrocode} |
| 1086 |
\DeclareRobustCommand*{\mdyydate}{\renewcommand*{\formatdate}[3]{% |
| 1087 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 1088 |
\@dtctr=\@year% |
| 1089 |
\@FCmodulo{\@dtctr}{100}% |
| 1090 |
\the\@month\dateseparator \the\@day\dateseparator \twodigit\@dtctr}} |
| 1091 |
% \end{macrocode} |
| 1092 |
%\end{macro} |
| 1093 |
%\begin{macro}{\newdate} |
| 1094 |
% Define commands to save dates |
| 1095 |
% and later format them. Store a given date: |
| 1096 |
%\changes{2.45}{2005/05/01}{new} |
| 1097 |
% \begin{macrocode} |
| 1098 |
\newcommand*{\newdate}[4]{% |
| 1099 |
\@ifundefined{date@#1@y}{% |
| 1100 |
\@namedef{date@#1@d}{#2}% |
| 1101 |
\@namedef{date@#1@m}{#3}% |
| 1102 |
\@namedef{date@#1@y}{#4}}{% |
| 1103 |
\PackageError{datetime}{Date `#1' already defined}{}}} |
| 1104 |
% \end{macrocode} |
| 1105 |
%\end{macro} |
| 1106 |
%\begin{macro}{\getdateyear} |
| 1107 |
% Display year from previously stored date |
| 1108 |
% \begin{macrocode} |
| 1109 |
\newcommand*{\getdateyear}[1]{% |
| 1110 |
\@ifundefined{date@#1@y}{% |
| 1111 |
\PackageError{datetime}{Date `#1' not defined}{}}{% |
| 1112 |
\csname date@#1@y\endcsname}} |
| 1113 |
% \end{macrocode} |
| 1114 |
%\end{macro} |
| 1115 |
%\begin{macro}{\getdatemonth} |
| 1116 |
% Display month from previously stored date |
| 1117 |
% \begin{macrocode} |
| 1118 |
\newcommand*{\getdatemonth}[1]{% |
| 1119 |
\@ifundefined{date@#1@m}{% |
| 1120 |
\PackageError{datetime}{Date `#1' not defined}{}}{% |
| 1121 |
\csname date@#1@m\endcsname}} |
| 1122 |
% \end{macrocode} |
| 1123 |
%\end{macro} |
| 1124 |
%\begin{macro}{\getdateday} |
| 1125 |
% Display day from previously stored date |
| 1126 |
% \begin{macrocode} |
| 1127 |
\newcommand{\getdateday}[1]{% |
| 1128 |
\@ifundefined{date@#1@d}{% |
| 1129 |
\PackageError{datetime}{Date `#1' not defined}{}}{% |
| 1130 |
\csname date@#1@d\endcsname}} |
| 1131 |
% \end{macrocode} |
| 1132 |
%\end{macro} |
| 1133 |
%\begin{macro}{\displaydate} |
| 1134 |
% Display a previously stored date using current date format |
| 1135 |
% \begin{macrocode} |
| 1136 |
\newcommand*{\displaydate}[1]{% |
| 1137 |
\@ifundefined{date@#1@y}{% |
| 1138 |
\PackageError{datetime}{Date `#1' not defined}{}}{% |
| 1139 |
\formatdate{\csname date@#1@d\endcsname}{% |
| 1140 |
\csname date@#1@m\endcsname}{% |
| 1141 |
\csname date@#1@y\endcsname}}} |
| 1142 |
% \end{macrocode} |
| 1143 |
%\end{macro} |
| 1144 |
% Set defaults: |
| 1145 |
% \begin{macrocode} |
| 1146 |
\longdate |
| 1147 |
\showdowtrue |
| 1148 |
% \end{macrocode} |
| 1149 |
% |
| 1150 |
%\changes{2.56}{2009/11/16}{moved definition of \cs{newdateformat} |
| 1151 |
% before cfg file loaded} |
| 1152 |
% Define |\newdateformat| which defines a declaration that redefines |\formatdate| so that |
| 1153 |
% it uses |\dateformat|. |\dateformat| takes four arguments, the first defines the format |
| 1154 |
% the last three arguments are the three arguments that effectively get passed to |\formatdate|. |
| 1155 |
% |\dateformat| sets |\@day|, |\@month| and |\@year|. |\c@DAY|, |\c@MONTH| and |\c@YEAR| |
| 1156 |
% are set as synonims for |\@day|, |\@month| and |\@year|, to that the uses can use the counters |
| 1157 |
% |DAY|, |MONTH| and |YEAR| as part of the format. |
| 1158 |
% The commands |\THEDAY|, |\THEMONTH| and |\THEYEAR| should only be |
| 1159 |
% used in the argument to |\newdateformat|. This is done partly to |
| 1160 |
% assist the \LaTeX2HTML version. |
| 1161 |
% |
| 1162 |
% This command must be defined before the configuration file is |
| 1163 |
% loaded, which in turn must be before the package options, therefore |
| 1164 |
% can't test for \texttt{nodate} package option. |
| 1165 |
% \begin{macrocode} |
| 1166 |
\providecommand*\THEDAY{\the\@day} |
| 1167 |
\providecommand*\THEMONTH{\the\@month} |
| 1168 |
\providecommand*\THEYEAR{\the\@year} |
| 1169 |
% \end{macrocode} |
| 1170 |
% Simulate a \LaTeX\ counter. |
| 1171 |
% \begin{macrocode} |
| 1172 |
\let\c@DAY=\@day |
| 1173 |
\let\c@MONTH=\@month |
| 1174 |
\let\c@YEAR=\@year |
| 1175 |
% \end{macrocode} |
| 1176 |
%\begin{macro}{\newdateformat} |
| 1177 |
% Provide a means to define a new date format. |
| 1178 |
%\changes{2.2}{2004/04/27}{new} |
| 1179 |
% \begin{macrocode} |
| 1180 |
\providecommand{\newdateformat}[2]{% |
| 1181 |
\@ifundefined{#1}{% |
| 1182 |
\expandafter\DeclareRobustCommand\csname#1\endcsname{% |
| 1183 |
\renewcommand{\formatdate}{\dateformat{#2}}}}{% |
| 1184 |
\PackageError{datetime}{Can't create new date format, command |
| 1185 |
\textbackslash#1 already defined}{You will need to |
| 1186 |
give your new date format a different name}}} |
| 1187 |
% \end{macrocode} |
| 1188 |
%\end{macro} |
| 1189 |
% \subsubsection{Time Macros} |
| 1190 |
%\begin{macro}{\currenttime} |
| 1191 |
% (New to v2.3) Define |\currenttime| which will print the |
| 1192 |
% time according to the current format. |
| 1193 |
%\changes{2.56}{2009/11/16}{change to use \cs{formattime}} |
| 1194 |
% \begin{macrocode} |
| 1195 |
\DeclareRobustCommand*{\currenttime}{% |
| 1196 |
\formattime{\currenthour}{\currentminute}{\currentsecond}% |
| 1197 |
} |
| 1198 |
% \end{macrocode} |
| 1199 |
%\end{macro} |
| 1200 |
%\begin{macro}{\formattime} |
| 1201 |
% Define \cs{formattime} analoguous to \cs{formatdate}. |
| 1202 |
% Set it to 24hr time by default |
| 1203 |
%\changes{2.56}{2009/11/16}{new} |
| 1204 |
% \begin{macrocode} |
| 1205 |
\newcommand*{\formattime}[3]{\protect\@formattime{#1}{#2}{#3}} |
| 1206 |
\newcommand*{\@formattime}[3]{% |
| 1207 |
\csname timeformat@xxivtime\endcsname{#1}{#2}{#3}} |
| 1208 |
% \end{macrocode} |
| 1209 |
%\end{macro} |
| 1210 |
%\begin{macro}{\timeseparator} |
| 1211 |
%\changes{2.43}{2005/02/25}{new} |
| 1212 |
% Define separator for numerical times: |
| 1213 |
% \begin{macrocode} |
| 1214 |
\newcommand*{\timeseparator}{:} |
| 1215 |
% \end{macrocode} |
| 1216 |
%\end{macro} |
| 1217 |
%\begin{macro}{\settimeformat} |
| 1218 |
% Switch to specified time format: |
| 1219 |
%\changes{2.3}{2004/05/01}{new} |
| 1220 |
%\changes{2.56}{2009/11/16}{now sets formattime} |
| 1221 |
% \begin{macrocode} |
| 1222 |
\providecommand*{\settimeformat}[1]{% |
| 1223 |
\@ifundefined{timeformat@#1}{% |
| 1224 |
\PackageError{datetime}{Unknown time format `#1'}{}% |
| 1225 |
}{% |
| 1226 |
\renewcommand*{\@formattime}[3]{% |
| 1227 |
\csname timeformat@#1\endcsname{##1}{##2}{##3}}% |
| 1228 |
}% |
| 1229 |
} |
| 1230 |
% \end{macrocode} |
| 1231 |
%\end{macro} |
| 1232 |
% Define a command to create a new time format, similar to the new |
| 1233 |
% date format. Again this is done in a way that makes it easier to |
| 1234 |
% code the \LaTeX2HTML version. |
| 1235 |
% \begin{macrocode} |
| 1236 |
\newcount\c@HOUR |
| 1237 |
\newcount\c@HOURXII |
| 1238 |
\newcount\c@MINUTE |
| 1239 |
\newcount\c@TOHOUR |
| 1240 |
\newcount\c@TOMINUTE |
| 1241 |
\newcount\c@SECOND |
| 1242 |
% \end{macrocode} |
| 1243 |
% These commands should only be used in |\newtimeformat|. |
| 1244 |
% \begin{macrocode} |
| 1245 |
\def\THEHOUR{\the\c@HOUR} |
| 1246 |
\def\THEHOURXII{\the\c@HOURXII} |
| 1247 |
\def\THEMINUTE{\the\c@MINUTE} |
| 1248 |
\def\THETOHOUR{\the\c@TOHOUR} |
| 1249 |
\def\THETOMINUTE{\the\c@TOMINUTE} |
| 1250 |
\def\THESECOND{\the\c@SECOND} |
| 1251 |
% \end{macrocode} |
| 1252 |
%\begin{macro}{\currenthour} |
| 1253 |
%\changes{2.56}{2009/11/16}{new} |
| 1254 |
% Store the current hour |
| 1255 |
% \begin{macrocode} |
| 1256 |
\newcount\currenthour |
| 1257 |
% \end{macrocode} |
| 1258 |
%\end{macro} |
| 1259 |
%\begin{macro}{\currentminute} |
| 1260 |
%\changes{2.56}{2009/11/16}{new} |
| 1261 |
% Store current minute |
| 1262 |
% \begin{macrocode} |
| 1263 |
\newcount\currentminute |
| 1264 |
% \end{macrocode} |
| 1265 |
%\end{macro} |
| 1266 |
%\begin{macro}{\currentsecond} |
| 1267 |
%\changes{2.56}{2009/11/16}{new} |
| 1268 |
\newcount\currentsecond |
| 1269 |
%\end{macro} |
| 1270 |
% Get time information from \cs{pdfcreationdate} (if it exists) |
| 1271 |
% \begin{macrocode} |
| 1272 |
{\catcode`\D=12\relax |
| 1273 |
\gdef\@dt@getdate D:#1#2#3#4#5#6#7#8{\@dt@gettime}% |
| 1274 |
} |
| 1275 |
\@ifundefined{pdfcreationdate}{% |
| 1276 |
\currenthour=\time\relax |
| 1277 |
\divide\currenthour by 60\relax |
| 1278 |
\currentminute=\time\relax |
| 1279 |
\@FCmodulo{\currentminute}{60}% |
| 1280 |
\currentsecond=0\relax |
| 1281 |
}{% |
| 1282 |
\def\@dt@gettime#1#2#3#4#5#6#7\relax{% |
| 1283 |
\currenthour=#1#2\relax |
| 1284 |
\currentminute=#3#4\relax |
| 1285 |
\currentsecond=#5#6\relax}% |
| 1286 |
\expandafter\@dt@getdate\pdfcreationdate\relax |
| 1287 |
} |
| 1288 |
% \end{macrocode} |
| 1289 |
%\begin{macro}{\newtimeformat} |
| 1290 |
% Provide a means to define a new time format. |
| 1291 |
%\changes{2.3}{2004/05/01}{new} |
| 1292 |
%\changes{2.56}{2009/11/16}{added \cs{timeformat}@\meta{name}} |
| 1293 |
% \begin{macrocode} |
| 1294 |
\providecommand*{\newtimeformat}[2]{% |
| 1295 |
\@ifundefined{#1}{% |
| 1296 |
\expandafter\def\csname#1\endcsname{% |
| 1297 |
\csname timeformat@#1\endcsname{\currenthour}{\currentminute}% |
| 1298 |
{\currentsecond}% |
| 1299 |
}% |
| 1300 |
\expandafter\def\csname timeformat@#1\endcsname##1##2##3{% |
| 1301 |
\c@HOUR=##1% |
| 1302 |
\c@HOURXII=\c@HOUR |
| 1303 |
\ifnum\c@HOURXII>12 |
| 1304 |
\advance\c@HOURXII by -12\relax |
| 1305 |
\fi |
| 1306 |
\c@MINUTE=##2% |
| 1307 |
\c@TOHOUR=\c@HOURXII |
| 1308 |
\advance\c@TOHOUR by 1\relax |
| 1309 |
\@FCmodulo{\c@TOHOUR}{12}% |
| 1310 |
\c@TOMINUTE=\c@MINUTE |
| 1311 |
\advance\c@TOMINUTE by -60\relax |
| 1312 |
\multiply\c@TOMINUTE by -1\relax |
| 1313 |
\c@SECOND=##3\relax |
| 1314 |
#2\relax |
| 1315 |
}}{% |
| 1316 |
\PackageError{datetime}{Command \textbackslash#1 already defined}{% |
| 1317 |
You can't create a new time format called "#1" as the command |
| 1318 |
\textbackslash#1 already exists}}} |
| 1319 |
% \end{macrocode} |
| 1320 |
%\end{macro} |
| 1321 |
%\begin{macro}{\xxivtime} |
| 1322 |
% Define commands to print the current time. Twenty-four hour time: |
| 1323 |
% \begin{macrocode} |
| 1324 |
\newtimeformat{xxivtime}{% |
| 1325 |
\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} |
| 1326 |
% \end{macrocode} |
| 1327 |
%\end{macro} |
| 1328 |
%\begin{macro}{\hhmmsstime} |
| 1329 |
% Twenty-four hour time including seconds. |
| 1330 |
% \begin{macrocode} |
| 1331 |
\newtimeformat{hhmmsstime}{% |
| 1332 |
\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE\timeseparator |
| 1333 |
\twodigit\THESECOND} |
| 1334 |
% \end{macrocode} |
| 1335 |
%\end{macro} |
| 1336 |
%\begin{macro}{\ampmtime} |
| 1337 |
% 12-hour time: |
| 1338 |
%\changes{2.3}{2004/05/01}{fixed minor bug} |
| 1339 |
%\changes{2.51}{2007/01/30}{fixed bug between midnight and 1am} |
| 1340 |
% \begin{macrocode} |
| 1341 |
\newtimeformat{ampmtime}{% |
| 1342 |
\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator |
| 1343 |
\twodigit\THEMINUTE |
| 1344 |
\ifthenelse{\value{HOUR}<12}{\amname}{% |
| 1345 |
\ifthenelse{\value{HOUR}=12}{ \noon}{\pmname}}} |
| 1346 |
% \end{macrocode} |
| 1347 |
%\end{macro} |
| 1348 |
% Textual time: |
| 1349 |
%\begin{macro}{\hourstring} |
| 1350 |
% \cs{hourstring}\marg{count} will print |\midnight| if |
| 1351 |
% \meta{count} is 0, otherwise will do \cs{Numberstring}\marg{count}. |
| 1352 |
% \begin{macrocode} |
| 1353 |
\newcommand*{\hourstring}[1]{% |
| 1354 |
\ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} |
| 1355 |
% \end{macrocode} |
| 1356 |
%\end{macro} |
| 1357 |
%\begin{macro}{\oclock} |
| 1358 |
%\changes{2.43}{2005/02/23}{fixed bug causing an infinite loop on the hour} |
| 1359 |
% \begin{macrocode} |
| 1360 |
\newtimeformat{oclock}{% |
| 1361 |
\ifthenelse{\(\value{HOUR}=0 \OR \value{HOUR}=12 \OR\value{HOUR}=24\)\AND |
| 1362 |
\value{MINUTE}=0}{% |
| 1363 |
% \end{macrocode} |
| 1364 |
% Midnight or Midday: |
| 1365 |
% \begin{macrocode} |
| 1366 |
\ifthenelse{\value{HOUR}=12}{\noon}{\midnight}}{% |
| 1367 |
% \end{macrocode} |
| 1368 |
% Neither Midnight nor Midday. |
| 1369 |
% Do minutes first |
| 1370 |
% \begin{macrocode} |
| 1371 |
\ifthenelse{\value{MINUTE}=0}{% |
| 1372 |
% \end{macrocode} |
| 1373 |
% On the hour: don't print any minutes, just do the hour and |
| 1374 |
% |\oclockstring| |
| 1375 |
% \begin{macrocode} |
| 1376 |
\Numberstring{HOUR} \oclockstring}{% |
| 1377 |
\ifthenelse{\value{MINUTE}=15}{% |
| 1378 |
\quarterpast\ \hourstring{HOUR}}{% |
| 1379 |
\ifthenelse{\value{MINUTE}=30}{% |
| 1380 |
\halfpast\ \hourstring{HOUR}}{% |
| 1381 |
\ifthenelse{\value{MINUTE}=45}{% |
| 1382 |
\quarterto\ \hourstring{TOHOUR}}{% |
| 1383 |
\ifthenelse{\value{MINUTE}<30}{% |
| 1384 |
\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} |
| 1385 |
past \hourstring{HOURXII}}{% |
| 1386 |
\Numberstring{TOMINUTE}\ \ifthenelse{% |
| 1387 |
\value{TOMINUTE}=1}{minute}{minutes} to \hourstring{TOHOUR}}}}}}% |
| 1388 |
% \end{macrocode} |
| 1389 |
% Now say whether it is morning or afternoon |
| 1390 |
% \begin{macrocode} |
| 1391 |
\ifthenelse{\value{HOUR}<12}{% |
| 1392 |
% \end{macrocode} |
| 1393 |
% Morning |
| 1394 |
% \begin{macrocode} |
| 1395 |
\ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% |
| 1396 |
% \end{macrocode} |
| 1397 |
% Afternoon |
| 1398 |
% \begin{macrocode} |
| 1399 |
\ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} |
| 1400 |
% \end{macrocode} |
| 1401 |
%\end{macro} |
| 1402 |
% Define textual strings used in the above. |
| 1403 |
%\begin{macro}{\amname} |
| 1404 |
% \begin{macrocode} |
| 1405 |
\providecommand*{\amname}{am} |
| 1406 |
% \end{macrocode} |
| 1407 |
%\end{macro} |
| 1408 |
%\begin{macro}{\pmname} |
| 1409 |
% \begin{macrocode} |
| 1410 |
\providecommand*{\pmname}{pm} |
| 1411 |
% \end{macrocode} |
| 1412 |
%\end{macro} |
| 1413 |
%\begin{macro}{\amorpmname} |
| 1414 |
%\changes{2.60}{2015-03-20}{fixed bug} |
| 1415 |
% \begin{macrocode} |
| 1416 |
\providecommand*{\amorpmname}{% |
| 1417 |
\ifthenelse{\value{HOUR}>11}{\pmname}{\amname}} |
| 1418 |
% \end{macrocode} |
| 1419 |
%\end{macro} |
| 1420 |
%\begin{macro}{\amstring} |
| 1421 |
% \begin{macrocode} |
| 1422 |
\providecommand*{\amstring}{in the morning} |
| 1423 |
% \end{macrocode} |
| 1424 |
%\end{macro} |
| 1425 |
%\begin{macro}{\pmstring} |
| 1426 |
% \begin{macrocode} |
| 1427 |
\providecommand*{\pmstring}{in the afternoon} |
| 1428 |
% \end{macrocode} |
| 1429 |
%\end{macro} |
| 1430 |
%\begin{macro}{\amorpmstring} |
| 1431 |
% \begin{macrocode} |
| 1432 |
\providecommand*{\amorpmstring}{% |
| 1433 |
\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} |
| 1434 |
% \end{macrocode} |
| 1435 |
%\end{macro} |
| 1436 |
%\begin{macro}{\halfpast} |
| 1437 |
% \begin{macrocode} |
| 1438 |
\providecommand*{\halfpast}{Half past} |
| 1439 |
% \end{macrocode} |
| 1440 |
%\end{macro} |
| 1441 |
%\begin{macro}{\quarterpast} |
| 1442 |
% \begin{macrocode} |
| 1443 |
\providecommand*{\quarterpast}{Quarter past} |
| 1444 |
% \end{macrocode} |
| 1445 |
%\end{macro} |
| 1446 |
%\begin{macro}{\quarterto} |
| 1447 |
% \begin{macrocode} |
| 1448 |
\providecommand*{\quarterto}{Quarter to} |
| 1449 |
% \end{macrocode} |
| 1450 |
%\end{macro} |
| 1451 |
%\begin{macro}{\noon} |
| 1452 |
% \begin{macrocode} |
| 1453 |
\providecommand*{\noon}{Noon} |
| 1454 |
% \end{macrocode} |
| 1455 |
%\end{macro} |
| 1456 |
%\begin{macro}{\midnight} |
| 1457 |
% \begin{macrocode} |
| 1458 |
\providecommand*{\midnight}{Midnight} |
| 1459 |
% \end{macrocode} |
| 1460 |
%\end{macro} |
| 1461 |
%\begin{macro}{\oclockstring} |
| 1462 |
% \begin{macrocode} |
| 1463 |
\providecommand*{\oclockstring}{O'Clock} |
| 1464 |
% \end{macrocode} |
| 1465 |
%\end{macro} |
| 1466 |
%\subsubsection{Configuration File} |
| 1467 |
% Load in specifications from configuration file: |
| 1468 |
%\changes{2.4}{2004/09/25}{added provision for configuration file |
| 1469 |
%datetime.cfg} |
| 1470 |
% \begin{macrocode} |
| 1471 |
\InputIfFileExists{datetime.cfg}{\PackageInfo{datetime}{% |
| 1472 |
Loading local datetime configurations}}{% |
| 1473 |
\PackageInfo{datetime}{No datetime.cfg file found, using default |
| 1474 |
settings}} |
| 1475 |
% \end{macrocode} |
| 1476 |
%\subsubsection{Package Options} |
| 1477 |
% Package options need to override \sty{babel}, so define command to |
| 1478 |
% add date format to \sty{babel}'s extras. |
| 1479 |
% \begin{macrocode} |
| 1480 |
\@ifpackageloaded{babel}{% |
| 1481 |
\newcommand*{\dt@addtoextras}[1]{% |
| 1482 |
\@ifundefined{extrasenglish}{}{% |
| 1483 |
\addto\extrasenglish{#1}% |
| 1484 |
}% |
| 1485 |
\@ifundefined{extrasamerican}{}{% |
| 1486 |
\addto\extrasamerican{#1}% |
| 1487 |
}% |
| 1488 |
\@ifundefined{extrasaustrian}{}{% |
| 1489 |
\addto\extrasaustrian{#1}% |
| 1490 |
}% |
| 1491 |
\@ifundefined{extrasaustralian}{}{% |
| 1492 |
\addto\extrasaustralian{#1}% |
| 1493 |
}% |
| 1494 |
\@ifundefined{extrasbahasa}{}{% |
| 1495 |
\addto\extrasbahasa{#1}% |
| 1496 |
}% |
| 1497 |
\@ifundefined{extrasbreton}{}{% |
| 1498 |
\addto\extrasbreton{#1}% |
| 1499 |
}% |
| 1500 |
\@ifundefined{extrasbritish}{}{% |
| 1501 |
\addto\extrasbritish{#1}% |
| 1502 |
}% |
| 1503 |
\@ifundefined{extrasbulgarian}{}{% |
| 1504 |
\addto\extrasbulgarian{#1}% |
| 1505 |
}% |
| 1506 |
\@ifundefined{extrascanadian}{}{% |
| 1507 |
\addto\extrascanadian{#1}% |
| 1508 |
}% |
| 1509 |
\@ifundefined{extrascatalan}{}{% |
| 1510 |
\addto\extrascatalan{#1}% |
| 1511 |
}% |
| 1512 |
\@ifundefined{extrascroatian}{}{% |
| 1513 |
\addto\extrascroatian{#1}% |
| 1514 |
}% |
| 1515 |
\@ifundefined{extrasczech}{}{% |
| 1516 |
\addto\extrasczech{#1}% |
| 1517 |
}% |
| 1518 |
\@ifundefined{extrasdanish}{}{% |
| 1519 |
\addto\extrasdanish{#1}% |
| 1520 |
}% |
| 1521 |
\@ifundefined{extrasesperanto}{}{% |
| 1522 |
\addto\extrasesperanto{#1}% |
| 1523 |
}% |
| 1524 |
\@ifundefined{extrasestonian}{}{% |
| 1525 |
\addto\extrasestonian{#1}% |
| 1526 |
}% |
| 1527 |
\@ifundefined{extrasfinnish}{}{% |
| 1528 |
\addto\extrasfinnish{#1}% |
| 1529 |
}% |
| 1530 |
\@ifundefined{extrasfrench}{}{% |
| 1531 |
\addto\extrasfrench{#1}% |
| 1532 |
}% |
| 1533 |
\@ifundefined{extrasgalician}{}{% |
| 1534 |
\addto\extrasgalician{#1}% |
| 1535 |
}% |
| 1536 |
\@ifundefined{extrasgerman}{}{% |
| 1537 |
\addto\extrasgerman{#1}% |
| 1538 |
}% |
| 1539 |
\@ifundefined{extrasgreek}{}{% |
| 1540 |
\addto\extrasgreek{#1}% |
| 1541 |
}% |
| 1542 |
\@ifundefined{extrashebrew}{}{% |
| 1543 |
\addto\extrashebrew{#1}% |
| 1544 |
}% |
| 1545 |
\@ifundefined{extrasicelandic}{}{% |
| 1546 |
\addto\extrasicelandic{#1}% |
| 1547 |
}% |
| 1548 |
\@ifundefined{extrasirish}{}{% |
| 1549 |
\addto\extrasirish{#1}% |
| 1550 |
}% |
| 1551 |
\@ifundefined{extrasitalian}{}{% |
| 1552 |
\addto\extrasitalian{#1}% |
| 1553 |
}% |
| 1554 |
\@ifundefined{extraslatin}{}{% |
| 1555 |
\addto\extraslatin{#1}% |
| 1556 |
}% |
| 1557 |
\@ifundefined{extraslsorbian}{}{% |
| 1558 |
\addto\extraslsorbian{#1}% |
| 1559 |
}% |
| 1560 |
\@ifundefined{extrasmagyar}{}{% |
| 1561 |
\addto\extrasmagyar{#1}% |
| 1562 |
}% |
| 1563 |
\@ifundefined{extrasnaustrian}{}{% |
| 1564 |
\addto\extrasnaustrian{#1}% |
| 1565 |
}% |
| 1566 |
\@ifundefined{extrasngerman}{}{% |
| 1567 |
\addto\extrasngerman{#1}% |
| 1568 |
}% |
| 1569 |
\@ifundefined{extrasnewzealand}{}{% |
| 1570 |
\addto\extrasnewzealand{#1}% |
| 1571 |
}% |
| 1572 |
\@ifundefined{extrasnorsk}{}{% |
| 1573 |
\addto\extrasnorsk{#1}% |
| 1574 |
}% |
| 1575 |
\@ifundefined{extraspolish}{}{% |
| 1576 |
\addto\extraspolish{#1}% |
| 1577 |
}% |
| 1578 |
\@ifundefined{extrasportuges}{}{% |
| 1579 |
\addto\extrasportuges{#1}% |
| 1580 |
}% |
| 1581 |
\@ifundefined{extrasromanian}{}{% |
| 1582 |
\addto\extrasromanian{#1}% |
| 1583 |
}% |
| 1584 |
\@ifundefined{extrasrussian}{}{% |
| 1585 |
\addto\extrasrussian{#1}% |
| 1586 |
}% |
| 1587 |
\@ifundefined{extrassamin}{}{% |
| 1588 |
\addto\extrassamin{#1}% |
| 1589 |
}% |
| 1590 |
\@ifundefined{extrasscottish}{}{% |
| 1591 |
\addto\extrasscottish{#1}% |
| 1592 |
}% |
| 1593 |
\@ifundefined{extrasserbian}{}{% |
| 1594 |
\addto\extrasserbian{#1}% |
| 1595 |
}% |
| 1596 |
\@ifundefined{extrasslovak}{}{% |
| 1597 |
\addto\extrasslovak{#1}% |
| 1598 |
}% |
| 1599 |
\@ifundefined{extrasslovene}{}{% |
| 1600 |
\addto\extrasslovene{#1}% |
| 1601 |
}% |
| 1602 |
\@ifundefined{extrasspanish}{}{% |
| 1603 |
\addto\extrasspanish{#1}% |
| 1604 |
}% |
| 1605 |
\@ifundefined{extrasswedish}{}{% |
| 1606 |
\addto\extrasswedish{#1}% |
| 1607 |
}% |
| 1608 |
\@ifundefined{extrasturkish}{}{% |
| 1609 |
\addto\extrasturkish{#1}% |
| 1610 |
}% |
| 1611 |
\@ifundefined{extrasUKenglish}{}{% |
| 1612 |
\addto\extrasUKenglish{#1}% |
| 1613 |
}% |
| 1614 |
\@ifundefined{extrasukraine}{}{% |
| 1615 |
\addto\extrasukraine{#1}% |
| 1616 |
}% |
| 1617 |
\@ifundefined{extrasUSenglish}{}{% |
| 1618 |
\addto\extrasUSenglish{#1}% |
| 1619 |
}% |
| 1620 |
\@ifundefined{extrasusorbian}{}{% |
| 1621 |
\addto\extrasusorbian{#1}% |
| 1622 |
}% |
| 1623 |
\@ifundefined{extraswelsh}{}{% |
| 1624 |
\addto\extraswelsh{#1}% |
| 1625 |
}% |
| 1626 |
} |
| 1627 |
}{% |
| 1628 |
\newcommand*{\dt@addtoextras}[1]{} |
| 1629 |
} |
| 1630 |
% \end{macrocode} |
| 1631 |
%\begin{macro}{setdefaultdate} |
| 1632 |
% Set default date. |
| 1633 |
% \begin{macrocode} |
| 1634 |
\newcommand*{\setdefaultdate}[1]{\dt@addtoextras{#1}#1} |
| 1635 |
% \end{macrocode} |
| 1636 |
%\end{macro} |
| 1637 |
% Specify the package options, specify default options and process |
| 1638 |
% \begin{macrocode} |
| 1639 |
\RequirePackage{fmtcount} |
| 1640 |
\DeclareOption{long}{\setdefaultdate{\longdate}} |
| 1641 |
\DeclareOption{short}{\setdefaultdate{\shortdate}} |
| 1642 |
\DeclareOption{yyyymmdd}{\setdefaultdate{\yyyymmdddate}} |
| 1643 |
\DeclareOption{ddmmyyyy}{\setdefaultdate{\ddmmyyyydate}} |
| 1644 |
\DeclareOption{dmyyyy}{\setdefaultdate{\dmyyyydate}} |
| 1645 |
\DeclareOption{ddmmyy}{\setdefaultdate{\ddmmyydate}} |
| 1646 |
\DeclareOption{dmyy}{\setdefaultdate{\dmyydate}} |
| 1647 |
\DeclareOption{text}{\setdefaultdate{\textdate}} |
| 1648 |
\DeclareOption{us}{\setdefaultdate{\usdate}} |
| 1649 |
\DeclareOption{mmddyyyy}{\setdefaultdate{\mmddyyyydate}} |
| 1650 |
\DeclareOption{mdyyyy}{\setdefaultdate{\mdyyyydate}} |
| 1651 |
\DeclareOption{mmddyy}{\setdefaultdate{\mmddyydate}} |
| 1652 |
\DeclareOption{mdyy}{\setdefaultdate{\mdyydate}} |
| 1653 |
\DeclareOption{level}{\fmtcountsetoptions{fmtord=level}} |
| 1654 |
\DeclareOption{raise}{\fmtcountsetoptions{fmtord=raise}} |
| 1655 |
\DeclareOption{dayofweek}{\showdowtrue} |
| 1656 |
\DeclareOption{nodayofweek}{\showdowfalse} |
| 1657 |
\DeclareOption{nodate}{\@dt@nodatetrue} |
| 1658 |
\DeclareOption{hhmmss}{\settimeformat{hhmmsstime}} |
| 1659 |
\DeclareOption{24hr}{\settimeformat{xxivtime}} |
| 1660 |
\DeclareOption{12hr}{\settimeformat{ampmtime}} |
| 1661 |
\DeclareOption{oclock}{\settimeformat{oclock}} |
| 1662 |
\DeclareOption{iso}{% |
| 1663 |
\setdefaultdate{\yyyymmdddate}\settimeformat{hhmmsstime}% |
| 1664 |
\renewcommand*{\dateseparator}{-}% |
| 1665 |
\renewcommand*{\timeseparator}{:}% |
| 1666 |
} |
| 1667 |
% \end{macrocode} |
| 1668 |
% |
| 1669 |
%\begin{macro}{\loadDTdef} |
| 1670 |
%\changes{2.58}{2010/09/21}{new} |
| 1671 |
% Load the datetime language definition file for the given language |
| 1672 |
% \begin{macrocode} |
| 1673 |
\newcommand*{\loadDTdef}[1]{% |
| 1674 |
% \end{macrocode} |
| 1675 |
% Check whether the file has already been loaded. |
| 1676 |
% \begin{macrocode} |
| 1677 |
\DTifDefLoaded{#1}% |
| 1678 |
% \end{macrocode} |
| 1679 |
% File already loaded, so do nothing. |
| 1680 |
% \begin{macrocode} |
| 1681 |
{}% |
| 1682 |
{% |
| 1683 |
\InputIfFileExists{dt-#1.def}% |
| 1684 |
{}% |
| 1685 |
{% |
| 1686 |
\PackageWarning{datetime}{Can't find datetime language |
| 1687 |
definition file for `#1'}% |
| 1688 |
}% |
| 1689 |
}% |
| 1690 |
} |
| 1691 |
% \end{macrocode} |
| 1692 |
%\end{macro} |
| 1693 |
% |
| 1694 |
%\begin{macro}{\DTifDefLoaded} |
| 1695 |
%\changes{2.59}{2013/09/10}{new} |
| 1696 |
% \begin{macrocode} |
| 1697 |
\newcommand{\DTifDefLoaded}[3]{% |
| 1698 |
\@ifundefined{ver@dt-#1.def}{#3}{#2}% |
| 1699 |
} |
| 1700 |
% \end{macrocode} |
| 1701 |
%\end{macro} |
| 1702 |
% |
| 1703 |
%\begin{macro}{\DTloadDefIfNotLoadedButExists} |
| 1704 |
%\changes{2.59}{2013/09/10}{new} |
| 1705 |
% \begin{macrocode} |
| 1706 |
\newcommand{\DTloadDefIfNotLoadedButExists}[1]{% |
| 1707 |
\DTifDefLoaded{#1}% |
| 1708 |
{}% |
| 1709 |
{% |
| 1710 |
\bgroup |
| 1711 |
\catcode `\@ 11\relax |
| 1712 |
\InputIfFileExists{dt-#1.def}{}{}% |
| 1713 |
\egroup |
| 1714 |
}% |
| 1715 |
}% |
| 1716 |
% \end{macrocode} |
| 1717 |
%\end{macro} |
| 1718 |
% |
| 1719 |
% Multilingual support. These package options shouldn't really be |
| 1720 |
% needed if babel has already been loaded. |
| 1721 |
% \begin{macrocode} |
| 1722 |
\DeclareOption{austrian}{\loadDTdef{austrian}} |
| 1723 |
\DeclareOption{american}{\loadDTdef{american}} |
| 1724 |
\DeclareOption{bahasa}{\loadDTdef{bahasa}} |
| 1725 |
\DeclareOption{basque}{\loadDTdef{basque}} |
| 1726 |
\DeclareOption{breton}{\loadDTdef{breton}} |
| 1727 |
\DeclareOption{british}{\loadDTdef{british}} |
| 1728 |
\DeclareOption{bulgarian}{\loadDTdef{bulgarian}} |
| 1729 |
\DeclareOption{catalan}{\loadDTdef{catalan}} |
| 1730 |
\DeclareOption{croatian}{\loadDTdef{croatian}} |
| 1731 |
\DeclareOption{czech}{\loadDTdef{czech}} |
| 1732 |
\DeclareOption{danish}{\loadDTdef{danish}} |
| 1733 |
\DeclareOption{dutch}{\loadDTdef{dutch}} |
| 1734 |
\DeclareOption{esperanto}{\loadDTdef{esperanto}} |
| 1735 |
\DeclareOption{estonian}{\loadDTdef{estonian}} |
| 1736 |
\DeclareOption{finnish}{\loadDTdef{finnish}} |
| 1737 |
\DeclareOption{french}{\loadDTdef{french}} |
| 1738 |
\DeclareOption{galician}{\loadDTdef{galician}} |
| 1739 |
\DeclareOption{german}{\loadDTdef{german}\dategerman} |
| 1740 |
\DeclareOption{greek}{\loadDTdef{greek}} |
| 1741 |
\DeclareOption{hebrew}{\loadDTdef{hebrew}} |
| 1742 |
\DeclareOption{icelandic}{\loadDTdef{icelandic}} |
| 1743 |
\DeclareOption{irish}{\loadDTdef{irish}} |
| 1744 |
\DeclareOption{italian}{\loadDTdef{italian}} |
| 1745 |
\DeclareOption{latin}{\loadDTdef{latin}} |
| 1746 |
\DeclareOption{lsorbian}{\loadDTdef{lsorbian}} |
| 1747 |
\DeclareOption{magyar}{\loadDTdef{magyar}} |
| 1748 |
\DeclareOption{naustrian}{\loadDTdef{naustrian}} |
| 1749 |
\DeclareOption{ngerman}{\loadDTdef{ngerman}\datengerman} |
| 1750 |
\DeclareOption{norsk}{\loadDTdef{norsk}} |
| 1751 |
\DeclareOption{polish}{\loadDTdef{polish}} |
| 1752 |
\DeclareOption{portuges}{\loadDTdef{portuges}} |
| 1753 |
\DeclareOption{romanian}{\loadDTdef{romanian}} |
| 1754 |
\DeclareOption{russian}{\loadDTdef{russian}} |
| 1755 |
\DeclareOption{samin}{\loadDTdef{samin}} |
| 1756 |
\DeclareOption{scottish}{\loadDTdef{scottish}} |
| 1757 |
\DeclareOption{serbian}{\loadDTdef{serbian}} |
| 1758 |
\DeclareOption{slovak}{\loadDTdef{slovak}} |
| 1759 |
\DeclareOption{slovene}{\loadDTdef{slovene}} |
| 1760 |
\DeclareOption{spanish}{\loadDTdef{spanish}} |
| 1761 |
\DeclareOption{swedish}{\loadDTdef{swedish}} |
| 1762 |
\DeclareOption{turkish}{\loadDTdef{turkish}} |
| 1763 |
\DeclareOption{ukraineb}{\loadDTdef{ukraineb}} |
| 1764 |
\DeclareOption{usorbian}{\loadDTdef{usorbian}} |
| 1765 |
\DeclareOption{UKenglish}{\loadDTdef{UKenglish}} |
| 1766 |
\DeclareOption{USenglish}{\loadDTdef{USenglish}} |
| 1767 |
\DeclareOption{welsh}{\loadDTdef{welsh}} |
| 1768 |
% \end{macrocode} |
| 1769 |
% Process package options |
| 1770 |
% \begin{macrocode} |
| 1771 |
\ProcessOptions |
| 1772 |
% \end{macrocode} |
| 1773 |
% \subsubsection{Date Specific Macros} |
| 1774 |
% \begin{macrocode} |
| 1775 |
\if@dt@nodate |
| 1776 |
\PackageInfo{datetime}{option "nodate" used, so note defining |
| 1777 |
\string\dateformat} |
| 1778 |
\else |
| 1779 |
% \end{macrocode} |
| 1780 |
%\begin{macro}{\dateformat} |
| 1781 |
% Format the given date in the given format. |
| 1782 |
% \begin{macrocode} |
| 1783 |
\providecommand*{\dateformat}[4]{% |
| 1784 |
\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} |
| 1785 |
% \end{macrocode} |
| 1786 |
%\end{macro} |
| 1787 |
% \begin{macrocode} |
| 1788 |
\fi |
| 1789 |
% \end{macrocode} |
| 1790 |
% Define the macro that prints the month name. |
| 1791 |
% (Only define this command if @dt@nodate is false) |
| 1792 |
% \begin{macrocode} |
| 1793 |
\if@dt@nodate |
| 1794 |
% \end{macrocode} |
| 1795 |
% The |nodate| option was used, so just print informative message, |
| 1796 |
% and do nothing else. |
| 1797 |
% \begin{macrocode} |
| 1798 |
\PackageInfo{datetime}{option "nodate" used, so not defining |
| 1799 |
\string\monthname} |
| 1800 |
\else |
| 1801 |
% \end{macrocode} |
| 1802 |
%\begin{macro}{\monthname} |
| 1803 |
%Define \verb|\monthname| to be language dependent. If there |
| 1804 |
%is no \verb|\monthname|\meta{language}, defaults to English. |
| 1805 |
% \begin{macrocode} |
| 1806 |
\newcommand*{\monthname}[1][\month]{% |
| 1807 |
\if@dt@multilingual |
| 1808 |
% \end{macrocode} |
| 1809 |
% Make sure language file has been loaded. |
| 1810 |
% \begin{macrocode} |
| 1811 |
\DTloadDefIfNotLoadedButExists{\languagename}% |
| 1812 |
\@ifundefined{monthname\languagename}% |
| 1813 |
{% |
| 1814 |
\PackageWarning{datetime}{No month names provided for language |
| 1815 |
'\languagename'}% |
| 1816 |
\monthnameenglish[#1]% |
| 1817 |
}% |
| 1818 |
{\csname monthname\languagename\endcsname[#1]}% |
| 1819 |
\else |
| 1820 |
\monthnameenglish[#1]% |
| 1821 |
\fi |
| 1822 |
} |
| 1823 |
% \end{macrocode} |
| 1824 |
%\end{macro} |
| 1825 |
% End of |\if@dt@nodate| else part: |
| 1826 |
% \begin{macrocode} |
| 1827 |
\fi |
| 1828 |
% \end{macrocode} |
| 1829 |
% Define the macro that prints the abbreviated month name |
| 1830 |
% (Again, only do this if @dt@nodate is false) |
| 1831 |
% \begin{macrocode} |
| 1832 |
\if@dt@nodate |
| 1833 |
% \end{macrocode} |
| 1834 |
% The |nodate| option was used, so just print informative message, |
| 1835 |
% and do nothing else. |
| 1836 |
% \begin{macrocode} |
| 1837 |
\PackageInfo{datetime}{option "nodate" used, so not defining |
| 1838 |
\protect\shortmonthname} |
| 1839 |
\else |
| 1840 |
% \end{macrocode} |
| 1841 |
%\begin{macro}{\shortmonthname} |
| 1842 |
%Define \verb|\shortmonthname| to be language dependent. If there |
| 1843 |
%is no \verb|\shortmonthname|\meta{language}, defaults to English. |
| 1844 |
% \begin{macrocode} |
| 1845 |
\newcommand*{\shortmonthname}[1][\month]{% |
| 1846 |
\if@dt@multilingual |
| 1847 |
% \end{macrocode} |
| 1848 |
% Make sure language file has been loaded. |
| 1849 |
% \begin{macrocode} |
| 1850 |
\DTloadDefIfNotLoadedButExists{\languagename}% |
| 1851 |
\@ifundefined{shortmonthname\languagename}% |
| 1852 |
{% |
| 1853 |
\PackageWarning{datetime}{No abbreviated month name defined for |
| 1854 |
language '\languagename', using full version instead}% |
| 1855 |
\monthname[#1]% |
| 1856 |
}% |
| 1857 |
{% |
| 1858 |
\csname shortmonthname\languagename\endcsname[#1]% |
| 1859 |
}% |
| 1860 |
\else |
| 1861 |
\shortmonthnameenglish[#1]% |
| 1862 |
\fi |
| 1863 |
} |
| 1864 |
% \end{macrocode} |
| 1865 |
%\end{macro} |
| 1866 |
% End of |\if@dt@nodate| else part: |
| 1867 |
% \begin{macrocode} |
| 1868 |
\fi |
| 1869 |
% \end{macrocode} |
| 1870 |
% Define macros needed to compute the weekday |
| 1871 |
% (Again, only do this if @dt@nodate is false) |
| 1872 |
%\begin{macro}{\ifDTleapyear} |
| 1873 |
% Need to define |\ifDTleapyear| regardless of @dt@nodate otherwise \LaTeX\ won't |
| 1874 |
% match |\ifDTleapyear| with |\fi| |
| 1875 |
%\changes{2.59}{2013/09/10}{renamed \cs{ifleapyear} to |
| 1876 |
%\cs{ifDTLleapyear} to avoid clash with other packages} |
| 1877 |
% \begin{macrocode} |
| 1878 |
\newif\ifDTleapyear |
| 1879 |
\@ifundefined{ifleapyear} |
| 1880 |
{% |
| 1881 |
% \end{macrocode} |
| 1882 |
% Provide backward compatibility: |
| 1883 |
% \begin{macrocode} |
| 1884 |
\def\ifleapyear{\ifDTLleapyear} |
| 1885 |
\let\leapyeartrue\DTLleapyeartrue |
| 1886 |
\let\leapyearfalse\DTLleapyearfalse |
| 1887 |
}% |
| 1888 |
{} |
| 1889 |
% \end{macrocode} |
| 1890 |
%\end{macro} |
| 1891 |
% Define temporary counter for arithmetic. |
| 1892 |
% \begin{macrocode} |
| 1893 |
\newcount\@dtctr |
| 1894 |
% \end{macrocode} |
| 1895 |
% If nodate, add a reminder in the log file that \verb|\dayofweek| |
| 1896 |
% is not defined. |
| 1897 |
% \begin{macrocode} |
| 1898 |
\if@dt@nodate |
| 1899 |
\PackageInfo{datetime}{option "nodate" used, so not defining |
| 1900 |
\string\dayofweek \space or \string\shortdayofweek} |
| 1901 |
\else |
| 1902 |
% \end{macrocode} |
| 1903 |
% Using the algorithm documented at |
| 1904 |
% http://userpages.wittenberg.edu/bshelburne/Comp150/DayofWeek.htm |
| 1905 |
% Syntax: \verb|testifleapyear{|\meta{year}\verb|}| sets |
| 1906 |
% conditional \verb|\ifDTleapyear|. |
| 1907 |
% \begin{macrocode} |
| 1908 |
\providecommand*{\testifleapyear}[1]{% |
| 1909 |
\DTleapyearfalse |
| 1910 |
\@year=#1\relax |
| 1911 |
\@dtctr=\@year |
| 1912 |
\@FCmodulo{\@dtctr}{400}% |
| 1913 |
\ifnum\@dtctr=0\relax |
| 1914 |
% \end{macrocode} |
| 1915 |
% year mod 400 = 0 => leap year |
| 1916 |
% \begin{macrocode} |
| 1917 |
\DTleapyeartrue |
| 1918 |
\else |
| 1919 |
\@dtctr=\@year |
| 1920 |
\@FCmodulo{\@dtctr}{100}% |
| 1921 |
\ifnum\@dtctr=0\relax |
| 1922 |
% \begin{macrocode} |
| 1923 |
% year mod 100 = 0 && year mod 400 != 0 => not a leap year |
| 1924 |
% \end{macrocode} |
| 1925 |
\DTleapyearfalse |
| 1926 |
\else |
| 1927 |
\@dtctr=\@year |
| 1928 |
\@FCmodulo{\@dtctr}{4}% |
| 1929 |
\ifnum\@dtctr=0\relax |
| 1930 |
% \begin{macrocode} |
| 1931 |
% year mod 4 = 0 && year mod 100 != 0 => leap year |
| 1932 |
% \end{macrocode} |
| 1933 |
\DTleapyeartrue |
| 1934 |
\fi |
| 1935 |
\fi |
| 1936 |
\fi |
| 1937 |
} |
| 1938 |
% \end{macrocode} |
| 1939 |
%\begin{macro}{\dayofyear} |
| 1940 |
% Count register in which to store the day of the year. |
| 1941 |
% \begin{macrocode} |
| 1942 |
\newcount\dayofyear |
| 1943 |
% \end{macrocode} |
| 1944 |
%\end{macro} |
| 1945 |
%\begin{macro}{\computedayofyear} |
| 1946 |
% \cs{computedayofyear}\marg{day}\marg{month}\marg{year}\par |
| 1947 |
% Computes the day of year. Result will be stored in \verb|\dayofyear| |
| 1948 |
% \begin{macrocode} |
| 1949 |
\providecommand*{\computedayofyear}[3]{% |
| 1950 |
\testifleapyear{#3}% |
| 1951 |
\dayofyear=0\relax |
| 1952 |
\@day=#1\relax \@month=#2\relax \@year=#3\relax |
| 1953 |
\ifcase\@month |
| 1954 |
\or |
| 1955 |
\or \advance\dayofyear by 31\relax |
| 1956 |
\or \advance\dayofyear by 59\relax |
| 1957 |
\or \advance\dayofyear by 90\relax |
| 1958 |
\or \advance\dayofyear by 120\relax |
| 1959 |
\or \advance\dayofyear by 151\relax |
| 1960 |
\or \advance\dayofyear by 181\relax |
| 1961 |
\or \advance\dayofyear by 212\relax |
| 1962 |
\or \advance\dayofyear by 243\relax |
| 1963 |
\or \advance\dayofyear by 273\relax |
| 1964 |
\or \advance\dayofyear by 304\relax |
| 1965 |
\or \advance\dayofyear by 334\relax |
| 1966 |
\else |
| 1967 |
\PackageError{datetime}{Invalid month number}{The second argument to |
| 1968 |
\string\computedayofyear \space should lie in the range 1-12}% |
| 1969 |
\fi |
| 1970 |
\ifnum\@month>2\relax |
| 1971 |
\ifDTleapyear\advance\dayofyear by 1\relax\fi |
| 1972 |
\fi |
| 1973 |
\advance\dayofyear by \@day\relax |
| 1974 |
} |
| 1975 |
% \end{macrocode} |
| 1976 |
%\end{macro} |
| 1977 |
%\begin{macro}{\dayofweek} |
| 1978 |
% Count register in which to store the day of the week. |
| 1979 |
% \begin{macrocode} |
| 1980 |
\newcount\dayofweek |
| 1981 |
% \end{macrocode} |
| 1982 |
%\end{macro} |
| 1983 |
%\begin{macro}{\computedayofweek} |
| 1984 |
% \cs{computedayofweek}\marg{day}\marg{month}\marg{year}\par |
| 1985 |
% Computes the day of week index. The result is stored in |
| 1986 |
% |\dayofweek|. |
| 1987 |
% \begin{macrocode} |
| 1988 |
\providecommand*{\computedayofweek}[3]{% |
| 1989 |
\computedayofyear{#1}{#2}{#3}% |
| 1990 |
\@dtctr=#3\relax |
| 1991 |
\advance\@dtctr by -1901\relax |
| 1992 |
\@FCmodulo{\@dtctr}{28}% |
| 1993 |
\dayofweek=\@dtctr |
| 1994 |
\divide\dayofweek by 4\relax |
| 1995 |
\advance\dayofweek by \@dtctr |
| 1996 |
\advance\dayofweek by 2\relax |
| 1997 |
\@FCmodulo{\dayofweek}{7}% |
| 1998 |
\advance\dayofweek by \dayofyear |
| 1999 |
\advance\dayofweek by -1\relax |
| 2000 |
\@FCmodulo{\dayofweek}{7}% |
| 2001 |
\advance\dayofweek by 1\relax |
| 2002 |
} |
| 2003 |
% \end{macrocode} |
| 2004 |
%\end{macro} |
| 2005 |
%\begin{macro}{\dayofweeknameid} |
| 2006 |
% Given the day of week index, print the associated name in the |
| 2007 |
% current language. If there is none defined for that language |
| 2008 |
% default to English. |
| 2009 |
% \begin{macrocode} |
| 2010 |
\providecommand*{\dayofweeknameid}[1]{% |
| 2011 |
\if@dt@multilingual |
| 2012 |
% \end{macrocode} |
| 2013 |
% Make sure language file has been loaded. |
| 2014 |
% \begin{macrocode} |
| 2015 |
\DTloadDefIfNotLoadedButExists{\languagename}% |
| 2016 |
\ifcsundef{dayofweeknameid\languagename}% |
| 2017 |
{% |
| 2018 |
\ifthenelse{\equal{\languagename}{nohyphenation}}{}% |
| 2019 |
{% |
| 2020 |
\PackageWarning{datetime}% |
| 2021 |
{No week day names defined for language |
| 2022 |
'\languagename', defaulting to English}% |
| 2023 |
}% |
| 2024 |
\dayofweeknameidenglish{#1}% |
| 2025 |
}% |
| 2026 |
{% |
| 2027 |
\csname dayofweeknameid\languagename\endcsname{#1}% |
| 2028 |
}% |
| 2029 |
\else |
| 2030 |
\dayofweeknameidenglish{#1}% |
| 2031 |
\fi |
| 2032 |
} |
| 2033 |
% \end{macrocode} |
| 2034 |
%\end{macro} |
| 2035 |
%\begin{macro}{\dayofweekname} |
| 2036 |
% Print the day of week name for the specified date. |
| 2037 |
% \begin{macrocode} |
| 2038 |
\providecommand*{\dayofweekname}[3]{% |
| 2039 |
\computedayofweek{#1}{#2}{#3}% |
| 2040 |
\dayofweeknameid{\dayofweek}% |
| 2041 |
} |
| 2042 |
% \end{macrocode} |
| 2043 |
%\end{macro} |
| 2044 |
%\begin{macro}{\thisdayofweekname} |
| 2045 |
% Print today's day of week name. |
| 2046 |
% \begin{macrocode} |
| 2047 |
\providecommand*{\thisdayofweekname}{% |
| 2048 |
\dayofweekname{\day}{\month}{\year}} |
| 2049 |
% \end{macrocode} |
| 2050 |
%\end{macro} |
| 2051 |
%\begin{macro}{\shortdayofweekname} |
| 2052 |
% Language dependant version: |
| 2053 |
% \begin{macrocode} |
| 2054 |
\providecommand*{\shortdayofweekname}[3]{% |
| 2055 |
\computedayofweek{#1}{#2}{#3}% |
| 2056 |
\if@dt@multilingual |
| 2057 |
% \end{macrocode} |
| 2058 |
% Make sure language file has been loaded. |
| 2059 |
% \begin{macrocode} |
| 2060 |
\DTloadDefIfNotLoadedButExists{\languagename}% |
| 2061 |
\@ifundefined{shortdayofweeknameid\languagename}% |
| 2062 |
{% |
| 2063 |
\ifthenelse{\equal{\languagename}{nohyphenation}}{}% |
| 2064 |
{% |
| 2065 |
\PackageWarning{datetime}% |
| 2066 |
{No abbreviated week day names defined for |
| 2067 |
language '\languagename', defaulting to long version}% |
| 2068 |
}% |
| 2069 |
\dayofweeknameid{\dayofweek}% |
| 2070 |
}% |
| 2071 |
{% |
| 2072 |
\csname shortdayofweeknameid\languagename\endcsname\dayofweek |
| 2073 |
}% |
| 2074 |
\else |
| 2075 |
\shortdayofweeknameidenglish{\dayofweek}% |
| 2076 |
\fi |
| 2077 |
} |
| 2078 |
% \end{macrocode} |
| 2079 |
%\end{macro} |
| 2080 |
%\begin{macro}{\thisshortdayofweekname} |
| 2081 |
% Today's week day name, abbreviated: |
| 2082 |
% \begin{macrocode} |
| 2083 |
\providecommand*{\thisshortdayofweekname}{% |
| 2084 |
\dayofweekname{\day}{\month}{\year}} |
| 2085 |
% \end{macrocode} |
| 2086 |
%\end{macro} |
| 2087 |
% End of |\if@dt@nodate| else part. |
| 2088 |
% \begin{macrocode} |
| 2089 |
\fi |
| 2090 |
% \end{macrocode} |
| 2091 |
%\begin{macro}{\today} |
| 2092 |
% Redefine |\today| so that it uses |\formatdate|. |
| 2093 |
% (Only do this if @dt@nodate is false) |
| 2094 |
%\changes{2.46}{2005/09/30}{defined using \cs{DeclareRobustCommand}} |
| 2095 |
%\changes{2.41}{2004/10/22}{defined using \cs{providecommand}} |
| 2096 |
% \begin{macrocode} |
| 2097 |
\if@dt@nodate |
| 2098 |
\else |
| 2099 |
\DeclareRobustCommand*{\today}{\formatdate{\day}{\month}{\year}} |
| 2100 |
\fi |
| 2101 |
% \end{macrocode} |
| 2102 |
%\end{macro} |
| 2103 |
%Check to see if babel package has redefined |\today|. |
| 2104 |
%\changes{2.53}{11 June 2007}{added check for \cs{dateUKenglish} and |
| 2105 |
%\cs{dateUSenglish}} |
| 2106 |
%\changes{2.54}{15 June 2007}{added check for \cs{datebritish}} |
| 2107 |
% \begin{macrocode} |
| 2108 |
\if@dt@nodate |
| 2109 |
\else |
| 2110 |
\@ifundefined{dateenglish}{}{\let\dateenglish\longdate} |
| 2111 |
\@ifundefined{dateUKenglish}{}{\loadDTdef{UKenglish}} |
| 2112 |
\@ifundefined{dateUSenglish}{}{\loadDTdef{USenglish}} |
| 2113 |
\@ifundefined{datebritish}{}{\loadDTdef{british}} |
| 2114 |
\@ifundefined{dateamerican}{}{\loadDTdef{american}} |
| 2115 |
\@ifundefined{dateaustrian}{}{\loadDTdef{austrian}} |
| 2116 |
\@ifundefined{dateaustralian}{}{\loadDTdef{australian}} |
| 2117 |
\@ifundefined{datebahasa}{}{\loadDTdef{bahasa}} |
| 2118 |
\@ifundefined{datebasque}{}{\loadDTdef{basque}} |
| 2119 |
\@ifundefined{datebreton}{}{\loadDTdef{breton}} |
| 2120 |
\@ifundefined{datebulgarian}{}{\loadDTdef{bulgarian}} |
| 2121 |
\@ifundefined{datecanadian}{}{\loadDTdef{canadian}} |
| 2122 |
\@ifundefined{datecatalan}{}{\loadDTdef{catalan}} |
| 2123 |
\@ifundefined{datecroatian}{}{\loadDTdef{croatian}} |
| 2124 |
\@ifundefined{dateczech}{}{\loadDTdef{czech}} |
| 2125 |
\@ifundefined{datedanish}{}{\loadDTdef{danish}} |
| 2126 |
\@ifundefined{datedutch}{}{\loadDTdef{dutch}} |
| 2127 |
\@ifundefined{dateesperanto}{}{\loadDTdef{esperanto}} |
| 2128 |
\@ifundefined{dateestonian}{}{\loadDTdef{estonian}} |
| 2129 |
\@ifundefined{datefinnish}{}{\loadDTdef{finnish}} |
| 2130 |
\@ifundefined{datefrench}{}{\loadDTdef{french}} |
| 2131 |
\@ifundefined{dategalician}{}{\loadDTdef{galician}} |
| 2132 |
\@ifundefined{dategerman}{}{\loadDTdef{german}} |
| 2133 |
\@ifundefined{dategreek}{}{\loadDTdef{greek}} |
| 2134 |
\@ifundefined{datehebrew}{}{\loadDTdef{hebrew}} |
| 2135 |
\@ifundefined{dateicelandic}{}{\loadDTdef{icelandic}} |
| 2136 |
\@ifundefined{dateirish}{}{\loadDTdef{irish}} |
| 2137 |
\@ifundefined{dateitalian}{}{\loadDTdef{italian}} |
| 2138 |
\@ifundefined{datelatin}{}{\loadDTdef{latin}} |
| 2139 |
\@ifundefined{datelsorbian}{}{\loadDTdef{lsorbian}} |
| 2140 |
\@ifundefined{datemagyar}{}{\loadDTdef{magyar}} |
| 2141 |
\@ifundefined{datenaustrian}{}{\loadDTdef{naustrian}} |
| 2142 |
\@ifundefined{datenewzealand}{}{\loadDTdef{newzealand}} |
| 2143 |
\@ifundefined{datengerman}{}{\loadDTdef{ngerman}} |
| 2144 |
\@ifundefined{datenorsk}{}{\loadDTdef{norsk}} |
| 2145 |
\@ifundefined{datepolish}{}{\loadDTdef{polish}} |
| 2146 |
\@ifundefined{dateportuges}{}{\loadDTdef{portuges}} |
| 2147 |
\@ifundefined{dateromanian}{}{\loadDTdef{romanian}} |
| 2148 |
\@ifundefined{daterussian}{}{\loadDTdef{russian}} |
| 2149 |
\@ifundefined{datesamin}{}{\loadDTdef{samin}} |
| 2150 |
\@ifundefined{datescottish}{}{\loadDTdef{scottish}} |
| 2151 |
\@ifundefined{dateserbian}{}{\loadDTdef{serbian}} |
| 2152 |
\@ifundefined{dateslovak}{}{\loadDTdef{slovak}} |
| 2153 |
\@ifundefined{dateslovene}{}{\loadDTdef{slovene}} |
| 2154 |
\@ifundefined{datespanish}{}{\loadDTdef{spanish}} |
| 2155 |
\@ifundefined{dateswedish}{}{\loadDTdef{swedish}} |
| 2156 |
\@ifundefined{dateturkish}{}{\loadDTdef{turkish}} |
| 2157 |
\@ifundefined{dateukraineb}{}{\loadDTdef{ukraineb}} |
| 2158 |
\@ifundefined{dateusorbian}{}{\loadDTdef{usorbian}} |
| 2159 |
\@ifundefined{datewelsh}{}{\loadDTdef{welsh}} |
| 2160 |
\fi |
| 2161 |
% \end{macrocode} |
| 2162 |
% |
| 2163 |
%\begin{macro}{\pdfdate} |
| 2164 |
% Finally create command that will typeset the date in PDF format |
| 2165 |
% e.g. 20040501215500. This is defined regardless of |\if@no@date| |
| 2166 |
% as it's provided for use in |\pdfinfo|. Initially |\pdfdate| is set |
| 2167 |
% to the year. Note that pdftex provides \cs{pdfcreationdate} |
| 2168 |
% which also stores the seconds and time zone. |
| 2169 |
%\changes{2.31}{2004/05/01}{new} |
| 2170 |
%\changes{2.32}{2004/05/04}{fixed bug} |
| 2171 |
% \begin{macrocode} |
| 2172 |
\newtoks\dt@a \newtoks\dt@b |
| 2173 |
\edef\pdfdate{\the\year} |
| 2174 |
% \end{macrocode} |
| 2175 |
% Append the month |
| 2176 |
% \begin{macrocode} |
| 2177 |
\dt@b=\expandafter{\pdfdate} |
| 2178 |
\dt@a=\expandafter{\the\month} |
| 2179 |
\ifnum\month<10\relax |
| 2180 |
\edef\pdfdate{\the\dt@b0\the\dt@a} |
| 2181 |
\else |
| 2182 |
\edef\pdfdate{\the\dt@b\the\dt@a} |
| 2183 |
\fi |
| 2184 |
% \end{macrocode} |
| 2185 |
% Append the day |
| 2186 |
% \begin{macrocode} |
| 2187 |
\dt@b=\expandafter{\pdfdate} |
| 2188 |
\dt@a=\expandafter{\the\day} |
| 2189 |
\ifnum\day<10\relax |
| 2190 |
\edef\pdfdate{\the\dt@b0\the\dt@a} |
| 2191 |
\else |
| 2192 |
\edef\pdfdate{\the\dt@b\the\dt@a} |
| 2193 |
\fi |
| 2194 |
% \end{macrocode} |
| 2195 |
% Append the hour |
| 2196 |
% \begin{macrocode} |
| 2197 |
\@dtctr=\time% |
| 2198 |
\divide\@dtctr by 60\relax |
| 2199 |
\dt@b=\expandafter{\pdfdate} |
| 2200 |
\dt@a=\expandafter{\the\@dtctr} |
| 2201 |
\ifnum\@dtctr<10 |
| 2202 |
\edef\pdfdate{\the\dt@b0\the\dt@a} |
| 2203 |
\else |
| 2204 |
\edef\pdfdate{\the\dt@b\the\dt@a} |
| 2205 |
\fi |
| 2206 |
% \end{macrocode} |
| 2207 |
% Append the minute. |
| 2208 |
% \begin{macrocode} |
| 2209 |
\@dtctr=\time% |
| 2210 |
\@FCmodulo{\@dtctr}{60}% |
| 2211 |
\dt@b=\expandafter{\pdfdate} |
| 2212 |
\dt@a=\expandafter{\the\@dtctr} |
| 2213 |
\ifnum\@dtctr<10\relax |
| 2214 |
\edef\pdfdate{\the\dt@b0\the\dt@a} |
| 2215 |
\else |
| 2216 |
\edef\pdfdate{\the\dt@b\the\dt@a} |
| 2217 |
\fi |
| 2218 |
% \end{macrocode} |
| 2219 |
% Append the seconds. |
| 2220 |
% \begin{macrocode} |
| 2221 |
\dt@a={00} |
| 2222 |
\dt@b=\expandafter{\pdfdate} |
| 2223 |
\edef\pdfdate{\the\dt@b\the\dt@a} |
| 2224 |
% \end{macrocode} |
| 2225 |
%\end{macro} |
| 2226 |
%\iffalse |
| 2227 |
% \begin{macrocode} |
| 2228 |
%</datetime.sty> |
| 2229 |
% \end{macrocode} |
| 2230 |
%\fi |
| 2231 |
%\iffalse |
| 2232 |
% \begin{macrocode} |
| 2233 |
%<*dt-american.def> |
| 2234 |
% \end{macrocode} |
| 2235 |
%\fi |
| 2236 |
%\subsection{Compatibility with Babel (Language definition files)} |
| 2237 |
%\subsubsection{american} |
| 2238 |
% Identify file |
| 2239 |
% \begin{macrocode} |
| 2240 |
\ProvidesFile{dt-american.def}[2013/09/10]% |
| 2241 |
% \end{macrocode} |
| 2242 |
%\begin{macro}{\dateamerican} |
| 2243 |
% \begin{macrocode} |
| 2244 |
\global\let\dateamerican\usdate |
| 2245 |
% \end{macrocode} |
| 2246 |
%\end{macro} |
| 2247 |
%\begin{macro}{\monthnameamerican} |
| 2248 |
% \begin{macrocode} |
| 2249 |
\global\let\monthnameamerican\monthnameenglish |
| 2250 |
% \end{macrocode} |
| 2251 |
%\end{macro} |
| 2252 |
%\begin{macro}{\shortmonthnameamerican} |
| 2253 |
% \begin{macrocode} |
| 2254 |
\global\let\shortmonthnameamerican\shortmonthnameenglish |
| 2255 |
% \end{macrocode} |
| 2256 |
%\end{macro} |
| 2257 |
%\begin{macro}{\dayofweeknameidamerican} |
| 2258 |
% \begin{macrocode} |
| 2259 |
\global\let\dayofweeknameidamerican\dayofweeknameidenglish |
| 2260 |
% \end{macrocode} |
| 2261 |
%\end{macro} |
| 2262 |
%\begin{macro}{\shortdayofweeknameamerican} |
| 2263 |
% \begin{macrocode} |
| 2264 |
\global\let\shortdayofweeknameidamerican\shortdayofweeknameidenglish |
| 2265 |
% \end{macrocode} |
| 2266 |
%\end{macro} |
| 2267 |
%\begin{macro}{\ordinaldateamerican} |
| 2268 |
% \begin{macrocode} |
| 2269 |
\providecommand*{\ordinaldateamerican}[1]{#1}% |
| 2270 |
\global\let\ordinaldateamerican\ordinaldateamerican |
| 2271 |
% \end{macrocode} |
| 2272 |
%\end{macro} |
| 2273 |
%\iffalse |
| 2274 |
% \begin{macrocode} |
| 2275 |
%</dt-american.def> |
| 2276 |
% \end{macrocode} |
| 2277 |
%\fi |
| 2278 |
%\iffalse |
| 2279 |
% \begin{macrocode} |
| 2280 |
%<*dt-australian.def> |
| 2281 |
% \end{macrocode} |
| 2282 |
%\fi |
| 2283 |
%\subsection{Compatibility with Babel (Language definition files)} |
| 2284 |
%\subsubsection{australian} |
| 2285 |
% Identify file |
| 2286 |
% \begin{macrocode} |
| 2287 |
\ProvidesFile{dt-australian.def}[2013/09/10]% |
| 2288 |
% \end{macrocode} |
| 2289 |
%\begin{macro}{\dateaustralian} |
| 2290 |
% \begin{macrocode} |
| 2291 |
\global\let\dateaustralian\usdate |
| 2292 |
% \end{macrocode} |
| 2293 |
%\end{macro} |
| 2294 |
%\begin{macro}{\monthnameaustralian} |
| 2295 |
% \begin{macrocode} |
| 2296 |
\global\let\monthnameaustralian\monthnameenglish |
| 2297 |
% \end{macrocode} |
| 2298 |
%\end{macro} |
| 2299 |
%\begin{macro}{\shortmonthnameaustralian} |
| 2300 |
% \begin{macrocode} |
| 2301 |
\global\let\shortmonthnameaustralian\shortmonthnameenglish |
| 2302 |
% \end{macrocode} |
| 2303 |
%\end{macro} |
| 2304 |
%\begin{macro}{\dayofweeknameidaustralian} |
| 2305 |
% \begin{macrocode} |
| 2306 |
\global\let\dayofweeknameidaustralian\dayofweeknameidenglish |
| 2307 |
% \end{macrocode} |
| 2308 |
%\end{macro} |
| 2309 |
%\begin{macro}{\shortdayofweeknameaustralian} |
| 2310 |
% \begin{macrocode} |
| 2311 |
\global\let\shortdayofweeknameidaustralian\shortdayofweeknameidenglish |
| 2312 |
% \end{macrocode} |
| 2313 |
%\end{macro} |
| 2314 |
%\begin{macro}{\ordinaldateaustralian} |
| 2315 |
% \begin{macrocode} |
| 2316 |
\providecommand*{\ordinaldateaustralian}[1]{#1}% |
| 2317 |
\global\let\ordinaldateaustralian\ordinaldateaustralian |
| 2318 |
% \end{macrocode} |
| 2319 |
%\end{macro} |
| 2320 |
%\iffalse |
| 2321 |
% \begin{macrocode} |
| 2322 |
%</dt-australian.def> |
| 2323 |
% \end{macrocode} |
| 2324 |
%\fi |
| 2325 |
%\iffalse |
| 2326 |
% \begin{macrocode} |
| 2327 |
%<*dt-austrian.def> |
| 2328 |
% \end{macrocode} |
| 2329 |
%\fi |
| 2330 |
%\subsubsection{Austrian} |
| 2331 |
% Identify file |
| 2332 |
% \begin{macrocode} |
| 2333 |
\ProvidesFile{dt-austrian.def}[2013/09/10]% |
| 2334 |
% \end{macrocode} |
| 2335 |
% Define month names. |
| 2336 |
%\begin{macro}{\monthnameaustrian} |
| 2337 |
% \begin{macrocode} |
| 2338 |
\providecommand{\monthnameaustrian}[1][\month]{% |
| 2339 |
\@orgargctr=#1\relax |
| 2340 |
\ifcase\@orgargctr |
| 2341 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2342 |
Month numbers should go from 1 to 12}% |
| 2343 |
\or J\"anner% |
| 2344 |
\or Februar% |
| 2345 |
\or M\"arz% |
| 2346 |
\or April% |
| 2347 |
\or Mai% |
| 2348 |
\or Juni% |
| 2349 |
\or Juli% |
| 2350 |
\or August% |
| 2351 |
\or September% |
| 2352 |
\or Oktober% |
| 2353 |
\or November% |
| 2354 |
\or Dezember% |
| 2355 |
\else |
| 2356 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2357 |
Month numbers should go from 1 (janvier) to 12 (decembre)}% |
| 2358 |
\fi}% |
| 2359 |
\global\let\monthnameaustrian\monthnameaustrian |
| 2360 |
% \end{macrocode} |
| 2361 |
%\end{macro} |
| 2362 |
% (Re)Define declaration to switch to this format. |
| 2363 |
%\begin{macro}{\dateaustrian} |
| 2364 |
% \begin{macrocode} |
| 2365 |
\DeclareRobustCommand*\dateaustrian{% |
| 2366 |
\renewcommand{\formatdate}[3]{% |
| 2367 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2368 |
\number\@day.~\monthnameaustrian[\@month]\space\number\@year}}% |
| 2369 |
\global\let\dateaustrian\dateaustrian |
| 2370 |
% \end{macrocode} |
| 2371 |
%\end{macro} |
| 2372 |
%\iffalse |
| 2373 |
% \begin{macrocode} |
| 2374 |
%</dt-austrian.def> |
| 2375 |
% \end{macrocode} |
| 2376 |
%\fi |
| 2377 |
%\iffalse |
| 2378 |
% \begin{macrocode} |
| 2379 |
%<*dt-bahasa.def> |
| 2380 |
% \end{macrocode} |
| 2381 |
%\fi |
| 2382 |
%\subsubsection{Bahasa} |
| 2383 |
% Identify file |
| 2384 |
% \begin{macrocode} |
| 2385 |
\ProvidesFile{dt-bahasa.def}[2013/09/10]% |
| 2386 |
% \end{macrocode} |
| 2387 |
% Define month names. |
| 2388 |
% \begin{macrocode} |
| 2389 |
\providecommand{\monthnamebahasa}[1][\month]{% |
| 2390 |
\@orgargctr=#1\relax |
| 2391 |
\ifcase\@orgargctr |
| 2392 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2393 |
Month numbers should go from 1 (Januari) to 12 (Desember)}% |
| 2394 |
\or Januari% |
| 2395 |
\or Pebruari% |
| 2396 |
\or Maret% |
| 2397 |
\or April% |
| 2398 |
\or Mei% |
| 2399 |
\or Juni% |
| 2400 |
\or Juli% |
| 2401 |
\or Agustus% |
| 2402 |
\or September% |
| 2403 |
\or Oktober% |
| 2404 |
\or Nopember% |
| 2405 |
\or Desember% |
| 2406 |
\else |
| 2407 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2408 |
Month numbers should go from 1 (Januari) to 12 (Desember)}% |
| 2409 |
\fi}% |
| 2410 |
\global\let\monthnamebahasa\monthnamebahasa |
| 2411 |
% \end{macrocode} |
| 2412 |
% Define abbreviated month names. This currently does the full |
| 2413 |
% name, because I don't know the abbreviated versions. |
| 2414 |
% \begin{macrocode} |
| 2415 |
\providecommand{\shortmonthnamebahasa}[1][\month]{% |
| 2416 |
\@orgargctr=#1\relax |
| 2417 |
\ifcase\@orgargctr |
| 2418 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2419 |
Month numbers should go from 1 (Januari) to 12 (Desember)}% |
| 2420 |
\or Januari% |
| 2421 |
\or Pebruari% |
| 2422 |
\or Maret% |
| 2423 |
\or April% |
| 2424 |
\or Mei% |
| 2425 |
\or Juni% |
| 2426 |
\or Juli% |
| 2427 |
\or Agustus% |
| 2428 |
\or September% |
| 2429 |
\or Oktober% |
| 2430 |
\or Nopember% |
| 2431 |
\or Desember% |
| 2432 |
\else |
| 2433 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2434 |
Month numbers should go from 1 (Januari) to 12 (Desember)}% |
| 2435 |
\fi}% |
| 2436 |
\global\let\shortmonthnamebahasa\shortmonthnamebahasa |
| 2437 |
% \end{macrocode} |
| 2438 |
% (Re)Define declaration to switch to this format. |
| 2439 |
% \begin{macrocode} |
| 2440 |
\DeclareRobustCommand*\datebahasa{% |
| 2441 |
\renewcommand{\formatdate}[3]{% |
| 2442 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2443 |
\number\@day}~\monthnamebahasa[\@month]\space \number\@year}}% |
| 2444 |
\global\let\datebahasa\datebahasa |
| 2445 |
% \end{macrocode} |
| 2446 |
%\iffalse |
| 2447 |
% \begin{macrocode} |
| 2448 |
%</dt-bahasa.def> |
| 2449 |
% \end{macrocode} |
| 2450 |
%\fi |
| 2451 |
%\iffalse |
| 2452 |
% \begin{macrocode} |
| 2453 |
%<*dt-basque.def> |
| 2454 |
% \end{macrocode} |
| 2455 |
%\fi |
| 2456 |
%\subsubsection{Basque} |
| 2457 |
% Identify file |
| 2458 |
% \begin{macrocode} |
| 2459 |
\ProvidesFile{dt-basque.def}[2013/09/10]% |
| 2460 |
% \end{macrocode} |
| 2461 |
% Define month names. |
| 2462 |
% \begin{macrocode} |
| 2463 |
\providecommand{\monthnamebasque}[1][\month]{% |
| 2464 |
\@orgargctr=#1\relax |
| 2465 |
\ifcase\@orgargctr |
| 2466 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2467 |
Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}% |
| 2468 |
\or urtarrilaren% |
| 2469 |
\or otsailaren% |
| 2470 |
\or martxoaren% |
| 2471 |
\or apirilaren% |
| 2472 |
\or maiatzaren% |
| 2473 |
\or ekainaren% |
| 2474 |
\or uztailaren% |
| 2475 |
\or abuztuaren% |
| 2476 |
\or irailaren% |
| 2477 |
\or urriaren% |
| 2478 |
\or azaroaren% |
| 2479 |
\or abenduaren% |
| 2480 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2481 |
Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}% |
| 2482 |
\fi}% |
| 2483 |
\global\let\monthnamebasque\monthnamebasque |
| 2484 |
% \end{macrocode} |
| 2485 |
% Define abbreviated month names. This currently does the full |
| 2486 |
% name, because I don't know the abbreviated versions. |
| 2487 |
% \begin{macrocode} |
| 2488 |
\providecommand{\shortmonthnamebasque}[1][\month]{% |
| 2489 |
\@orgargctr=#1\relax |
| 2490 |
\ifcase\@orgargctr |
| 2491 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2492 |
Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}% |
| 2493 |
\or urtarrilaren% |
| 2494 |
\or otsailaren% |
| 2495 |
\or martxoaren% |
| 2496 |
\or apirilaren% |
| 2497 |
\or maiatzaren% |
| 2498 |
\or ekainaren% |
| 2499 |
\or uztailaren% |
| 2500 |
\or abuztuaren% |
| 2501 |
\or irailaren% |
| 2502 |
\or urriaren% |
| 2503 |
\or azaroaren% |
| 2504 |
\or abenduaren% |
| 2505 |
\else |
| 2506 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2507 |
Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}% |
| 2508 |
\fi}% |
| 2509 |
\global\let\shortmonthnamebasque\shortmonthnamebasque |
| 2510 |
% \end{macrocode} |
| 2511 |
% (Re)Define declaration to switch to this format. |
| 2512 |
% \begin{macrocode} |
| 2513 |
\DeclareRobustCommand*\datebasque{% |
| 2514 |
\renewcommand{\formatdate}[3]{% |
| 2515 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2516 |
\number\@year.eko\space\monthnamebasque[\@month]~\number\@day}}% |
| 2517 |
\global\let\datebasque\datebasque |
| 2518 |
% \end{macrocode} |
| 2519 |
%\iffalse |
| 2520 |
% \begin{macrocode} |
| 2521 |
%</dt-basque.def> |
| 2522 |
% \end{macrocode} |
| 2523 |
%\fi |
| 2524 |
%\iffalse |
| 2525 |
% \begin{macrocode} |
| 2526 |
%<*dt-breton.def> |
| 2527 |
% \end{macrocode} |
| 2528 |
%\fi |
| 2529 |
%\subsubsection{Breton} |
| 2530 |
% Identify file |
| 2531 |
% \begin{macrocode} |
| 2532 |
\ProvidesFile{dt-breton.def}[2013/09/10]% |
| 2533 |
% \end{macrocode} |
| 2534 |
%\begin{macro}{\ordinaldatebreton} |
| 2535 |
% Breton version: |
| 2536 |
% \begin{macrocode} |
| 2537 |
\providecommand*{\ordinaldatebreton}[1]{% |
| 2538 |
#1\ifnum#1=1\/\textsuperscript{a\~n}\fi}% |
| 2539 |
\global\let\ordinaldatebreton\ordinaldatebreton |
| 2540 |
% \end{macrocode} |
| 2541 |
%\end{macro} |
| 2542 |
% Define month names. |
| 2543 |
% \begin{macrocode} |
| 2544 |
\providecommand{\monthnamebreton}[1][\month]{% |
| 2545 |
\@orgargctr=#1\relax |
| 2546 |
\ifcase\@orgargctr |
| 2547 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2548 |
Month numbers should go from 1 (Genver) to 12 (Kerzu)}% |
| 2549 |
\or Genver% |
| 2550 |
\or C'hwevrer% |
| 2551 |
\or Meurzh% |
| 2552 |
\or Ebrel% |
| 2553 |
\or Mae% |
| 2554 |
\or Mezheven% |
| 2555 |
\or Gouere% |
| 2556 |
\or Eost% |
| 2557 |
\or Gwengolo% |
| 2558 |
\or Here% |
| 2559 |
\or Du% |
| 2560 |
\or Kerzu% |
| 2561 |
\else |
| 2562 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2563 |
Month numbers should go from 1 (Genver) to 12 (Kerzu)}% |
| 2564 |
\fi}% |
| 2565 |
\global\let\monthnamebreton\monthnamebreton |
| 2566 |
% \end{macrocode} |
| 2567 |
% Define abbreviated month names. This currently does the full |
| 2568 |
% name, because I don't know the abbreviated versions. |
| 2569 |
% \begin{macrocode} |
| 2570 |
\providecommand{\shortmonthnamebreton}[1][\month]{% |
| 2571 |
\@orgargctr=#1\relax |
| 2572 |
\ifcase\@orgargctr |
| 2573 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2574 |
Month numbers should go from 1 (Genver) to 12 (Kerzu)}% |
| 2575 |
\or Genver% |
| 2576 |
\or C'hwevrer% |
| 2577 |
\or Meurzh% |
| 2578 |
\or Ebrel% |
| 2579 |
\or Mae% |
| 2580 |
\or Mezheven% |
| 2581 |
\or Gouere% |
| 2582 |
\or Eost% |
| 2583 |
\or Gwengolo% |
| 2584 |
\or Here% |
| 2585 |
\or Du% |
| 2586 |
\or Kerzu% |
| 2587 |
\else |
| 2588 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2589 |
Month numbers should go from 1 (Genver) to 12 (Kerzu)}% |
| 2590 |
\fi}% |
| 2591 |
\global\let\shortmonthnamebreton\shortmonthnamebreton |
| 2592 |
% \end{macrocode} |
| 2593 |
% (Re)Define declaration to switch to this format. |
| 2594 |
% \begin{macrocode} |
| 2595 |
\DeclareRobustCommand*\datebreton{% |
| 2596 |
\renewcommand{\formatdate}[3]{% |
| 2597 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2598 |
\ifnum\@day=1\relax 1\/\textsuperscript{a\~n}\else\number\@day\fi |
| 2599 |
\space a\space viz\space\monthnamebreton[\@month]\space |
| 2600 |
\number\@year |
| 2601 |
}}% |
| 2602 |
\global\let\datebreton\datebreton |
| 2603 |
% \end{macrocode} |
| 2604 |
%\iffalse |
| 2605 |
% \begin{macrocode} |
| 2606 |
%</dt-breton.def> |
| 2607 |
% \end{macrocode} |
| 2608 |
%\fi |
| 2609 |
%\iffalse |
| 2610 |
% \begin{macrocode} |
| 2611 |
%<*dt-british.def> |
| 2612 |
% \end{macrocode} |
| 2613 |
%\fi |
| 2614 |
%\subsubsection{british} |
| 2615 |
% Identify file |
| 2616 |
% \begin{macrocode} |
| 2617 |
\ProvidesFile{dt-british.def}[2013/09/10]% |
| 2618 |
% \end{macrocode} |
| 2619 |
%\begin{macro}{\datebritish} |
| 2620 |
% \begin{macrocode} |
| 2621 |
\global\let\datebritish\longdate |
| 2622 |
% \end{macrocode} |
| 2623 |
%\end{macro} |
| 2624 |
%\begin{macro}{\monthnamebritish} |
| 2625 |
% \begin{macrocode} |
| 2626 |
\global\let\monthnamebritish\monthnameenglish |
| 2627 |
% \end{macrocode} |
| 2628 |
%\end{macro} |
| 2629 |
%\begin{macro}{\shortmonthnamebritish} |
| 2630 |
% \begin{macrocode} |
| 2631 |
\global\let\shortmonthnamebritish\shortmonthnameenglish |
| 2632 |
% \end{macrocode} |
| 2633 |
%\end{macro} |
| 2634 |
%\begin{macro}{\dayofweeknameidbritish} |
| 2635 |
% \begin{macrocode} |
| 2636 |
\global\let\dayofweeknameidbritish\dayofweeknameidenglish |
| 2637 |
% \end{macrocode} |
| 2638 |
%\end{macro} |
| 2639 |
%\begin{macro}{\shortdayofweekidbritish} |
| 2640 |
% \begin{macrocode} |
| 2641 |
\global\let\shortdayofweeknameidbritish\shortdayofweeknameidenglish |
| 2642 |
% \end{macrocode} |
| 2643 |
%\end{macro} |
| 2644 |
%\begin{macro}{\ordinaldatebritish} |
| 2645 |
% \begin{macrocode} |
| 2646 |
\global\let\ordinaldatebritish\ordinaldateenglish |
| 2647 |
% \end{macrocode} |
| 2648 |
%\end{macro} |
| 2649 |
%\iffalse |
| 2650 |
% \begin{macrocode} |
| 2651 |
%</dt-british.def> |
| 2652 |
% \end{macrocode} |
| 2653 |
%\fi |
| 2654 |
%\iffalse |
| 2655 |
% \begin{macrocode} |
| 2656 |
%<*dt-bulgarian.def> |
| 2657 |
% \end{macrocode} |
| 2658 |
%\fi |
| 2659 |
%\subsubsection{Bulgarian} |
| 2660 |
% Identify file |
| 2661 |
% \begin{macrocode} |
| 2662 |
\ProvidesFile{dt-bulgarian.def}[2013/09/10]% |
| 2663 |
% \end{macrocode} |
| 2664 |
% Define month names. |
| 2665 |
% \begin{macrocode} |
| 2666 |
\providecommand{\monthnamebulgarian}[1][\month]{% |
| 2667 |
\@orgargctr=#1\relax |
| 2668 |
\ifcase\@orgargctr |
| 2669 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2670 |
Month numbers should go from 1 to 12}% |
| 2671 |
\or\cyrya\cyrn\cyru\cyra\cyrr\cyri\or |
| 2672 |
\cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or |
| 2673 |
\cyrm\cyra\cyrr\cyrt\or |
| 2674 |
\cyra\cyrp\cyrr\cyri\cyrl\or |
| 2675 |
\cyrm\cyra\cyrishrt\or |
| 2676 |
\cyryu\cyrn\cyri\or |
| 2677 |
\cyryu\cyrl\cyri\or |
| 2678 |
\cyra\cyrv\cyrg\cyru\cyrs\cyrt\or |
| 2679 |
\cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or |
| 2680 |
\cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or |
| 2681 |
\cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or |
| 2682 |
\cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri |
| 2683 |
\else |
| 2684 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2685 |
Month numbers should go from 1 to 12}% |
| 2686 |
\fi}% |
| 2687 |
\global\let\monthnamebulgarian\monthnamebulgarian |
| 2688 |
% \end{macrocode} |
| 2689 |
% Define abbreviated month names. This currently does the full |
| 2690 |
% name, because I don't know the abbreviated versions. |
| 2691 |
% \begin{macrocode} |
| 2692 |
\providecommand{\shortmonthnamebulgarian}[1][\month]{% |
| 2693 |
\@orgargctr=#1\relax |
| 2694 |
\ifcase\@orgargctr |
| 2695 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2696 |
Month numbers should go from 1 to 12}% |
| 2697 |
\or\cyrya\cyrn\cyru\cyra\cyrr\cyri\or |
| 2698 |
\cyrf\cyre\cyrv\cyrr\cyru\cyra\cyrr\cyri\or |
| 2699 |
\cyrm\cyra\cyrr\cyrt\or |
| 2700 |
\cyra\cyrp\cyrr\cyri\cyrl\or |
| 2701 |
\cyrm\cyra\cyrishrt\or |
| 2702 |
\cyryu\cyrn\cyri\or |
| 2703 |
\cyryu\cyrl\cyri\or |
| 2704 |
\cyra\cyrv\cyrg\cyru\cyrs\cyrt\or |
| 2705 |
\cyrs\cyre\cyrp\cyrt\cyre\cyrm\cyrv\cyrr\cyri\or |
| 2706 |
\cyro\cyrk\cyrt\cyro\cyrm\cyrv\cyrr\cyri\or |
| 2707 |
\cyrn\cyro\cyre\cyrm\cyrv\cyrr\cyri\or |
| 2708 |
\cyrd\cyre\cyrk\cyre\cyrm\cyrv\cyrr\cyri |
| 2709 |
\else |
| 2710 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2711 |
Month numbers should go from 1 to 12}% |
| 2712 |
\fi}% |
| 2713 |
\global\let\shortmonthnamebulgarian\shortmonthnamebulgarian |
| 2714 |
% \end{macrocode} |
| 2715 |
% (Re)Define declaration to switch to this format. |
| 2716 |
% \begin{macrocode} |
| 2717 |
\DeclareRobustCommand*\datebulgarian{% |
| 2718 |
\renewcommand{\formatdate}[3]{% |
| 2719 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2720 |
\number\@day~\monthnamebulgarian[\@month]\ \number\@year~\cyrg.}}% |
| 2721 |
\global\let\datebulgarian\datebulgarian |
| 2722 |
% \end{macrocode} |
| 2723 |
%\iffalse |
| 2724 |
% \begin{macrocode} |
| 2725 |
%</dt-bulgarian.def> |
| 2726 |
% \end{macrocode} |
| 2727 |
%\fi |
| 2728 |
%\iffalse |
| 2729 |
% \begin{macrocode} |
| 2730 |
%<*dt-canadian.def> |
| 2731 |
% \end{macrocode} |
| 2732 |
%\fi |
| 2733 |
%\subsection{Compatibility with Babel (Language definition files)} |
| 2734 |
%\subsubsection{canadian} |
| 2735 |
% Identify file |
| 2736 |
% \begin{macrocode} |
| 2737 |
\ProvidesFile{dt-canadian.def}[2013/09/10]% |
| 2738 |
% \end{macrocode} |
| 2739 |
%\begin{macro}{\datecanadian} |
| 2740 |
% \begin{macrocode} |
| 2741 |
\global\let\datecanadian\usdate |
| 2742 |
% \end{macrocode} |
| 2743 |
%\end{macro} |
| 2744 |
%\begin{macro}{\monthnamecanadian} |
| 2745 |
% \begin{macrocode} |
| 2746 |
\global\let\monthnamecanadian\monthnameenglish |
| 2747 |
% \end{macrocode} |
| 2748 |
%\end{macro} |
| 2749 |
%\begin{macro}{\shortmonthnamecanadian} |
| 2750 |
% \begin{macrocode} |
| 2751 |
\global\let\shortmonthnamecanadian\shortmonthnameenglish |
| 2752 |
% \end{macrocode} |
| 2753 |
%\end{macro} |
| 2754 |
%\begin{macro}{\dayofweeknameidcanadian} |
| 2755 |
% \begin{macrocode} |
| 2756 |
\global\let\dayofweeknameidcanadian\dayofweeknameidenglish |
| 2757 |
% \end{macrocode} |
| 2758 |
%\end{macro} |
| 2759 |
%\begin{macro}{\shortdayofweeknamecanadian} |
| 2760 |
% \begin{macrocode} |
| 2761 |
\global\let\shortdayofweeknameidcanadian\shortdayofweeknameidenglish |
| 2762 |
% \end{macrocode} |
| 2763 |
%\end{macro} |
| 2764 |
%\begin{macro}{\ordinaldatecanadian} |
| 2765 |
% \begin{macrocode} |
| 2766 |
\providecommand*{\ordinaldatecanadian}[1]{#1}% |
| 2767 |
\global\let\ordinaldatecanadian\ordinaldatecanadian |
| 2768 |
% \end{macrocode} |
| 2769 |
%\end{macro} |
| 2770 |
%\iffalse |
| 2771 |
% \begin{macrocode} |
| 2772 |
%</dt-canadian.def> |
| 2773 |
% \end{macrocode} |
| 2774 |
%\fi |
| 2775 |
%\iffalse |
| 2776 |
% \begin{macrocode} |
| 2777 |
%<*dt-catalan.def> |
| 2778 |
% \end{macrocode} |
| 2779 |
%\fi |
| 2780 |
%\subsubsection{Catalan} |
| 2781 |
% Identify file |
| 2782 |
% \begin{macrocode} |
| 2783 |
\ProvidesFile{dt-catalan.def}[2013/09/10]% |
| 2784 |
% \end{macrocode} |
| 2785 |
% Define month names. |
| 2786 |
% \begin{macrocode} |
| 2787 |
\providecommand{\monthnamecatalan}[1][\month]{% |
| 2788 |
\@orgargctr=#1\relax |
| 2789 |
\ifcase\@orgargctr |
| 2790 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2791 |
Month numbers should go from 1 (de gener) to 12 (de desembre)}% |
| 2792 |
\or de gener% |
| 2793 |
\or de febrer% |
| 2794 |
\or de mar\c{c}% |
| 2795 |
\or d'abril% |
| 2796 |
\or de maig% |
| 2797 |
\or de juny% |
| 2798 |
\or de juliol% |
| 2799 |
\or d'agost% |
| 2800 |
\or de setembre% |
| 2801 |
\or d'octubre% |
| 2802 |
\or de novembre% |
| 2803 |
\or de desembre% |
| 2804 |
\else |
| 2805 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2806 |
Month numbers should go from 1 (de gener) to 12 (de desembre)}% |
| 2807 |
\fi}% |
| 2808 |
\global\let\monthnamecatalan\monthnamecatalan |
| 2809 |
% \end{macrocode} |
| 2810 |
% Define abbreviated month names. This currently does the full |
| 2811 |
% name, because I don't know the abbreviated versions. |
| 2812 |
% \begin{macrocode} |
| 2813 |
\providecommand{\shortmonthnamecatalan}[1][\month]{% |
| 2814 |
\@orgargctr=#1\relax |
| 2815 |
\ifcase\@orgargctr |
| 2816 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2817 |
Month numbers should go from 1 (de gener) to 12 (de desembre)}% |
| 2818 |
\or de gener% |
| 2819 |
\or de febrer% |
| 2820 |
\or de mar\c{c}% |
| 2821 |
\or d'abril% |
| 2822 |
\or de maig% |
| 2823 |
\or de juny% |
| 2824 |
\or de juliol% |
| 2825 |
\or d'agost% |
| 2826 |
\or de setembre% |
| 2827 |
\or d'octubre% |
| 2828 |
\or de novembre% |
| 2829 |
\or de desembre% |
| 2830 |
\else |
| 2831 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2832 |
Month numbers should go from 1 (de gener) to 12 (de desembre)}% |
| 2833 |
\fi}% |
| 2834 |
\global\let\shortmonthnamecatalan\shortmonthnamecatalan |
| 2835 |
% \end{macrocode} |
| 2836 |
% (Re)Define declaration to switch to this format. |
| 2837 |
% \begin{macrocode} |
| 2838 |
\DeclareRobustCommand*\datecatalan{% |
| 2839 |
\renewcommand{\formatdate}[3]{% |
| 2840 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2841 |
\number\@day~\monthnamecatalan[\@month]\ de~\number\@year |
| 2842 |
}}% |
| 2843 |
\global\let\datecatalan\datecatalan |
| 2844 |
% \end{macrocode} |
| 2845 |
%\iffalse |
| 2846 |
% \begin{macrocode} |
| 2847 |
%</dt-catalan.def> |
| 2848 |
% \end{macrocode} |
| 2849 |
%\fi |
| 2850 |
%\iffalse |
| 2851 |
% \begin{macrocode} |
| 2852 |
%<*dt-croatian.def> |
| 2853 |
% \end{macrocode} |
| 2854 |
%\fi |
| 2855 |
%\subsubsection{Croatian} |
| 2856 |
% Identify file |
| 2857 |
% \begin{macrocode} |
| 2858 |
\ProvidesFile{dt-croatian.def}[2013/09/10]% |
| 2859 |
% \end{macrocode} |
| 2860 |
% Define month names. |
| 2861 |
% \begin{macrocode} |
| 2862 |
\providecommand{\monthnamecroatian}[1][\month]{% |
| 2863 |
\@orgargctr=#1\relax |
| 2864 |
\ifcase\@orgargctr |
| 2865 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2866 |
Month numbers should go from 1 (sijecnja) to 12 (prosinca)}% |
| 2867 |
\or sije\v{c}nja% |
| 2868 |
\or velja\v{c}e% |
| 2869 |
\or o\v{z}ujka% |
| 2870 |
\or travnja% |
| 2871 |
\or svibnja% |
| 2872 |
\or lipnja% |
| 2873 |
\or srpnja% |
| 2874 |
\or kolovoza% |
| 2875 |
\or rujna% |
| 2876 |
\or listopada% |
| 2877 |
\or studenoga% |
| 2878 |
\or prosinca% |
| 2879 |
\else |
| 2880 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2881 |
Month numbers should go from 1 (sijecnja) to 12 (prosinca)}% |
| 2882 |
\fi}% |
| 2883 |
\global\let\monthnamecroatian\monthnamecroatian |
| 2884 |
% \end{macrocode} |
| 2885 |
% Define abbreviated month names. This currently does the full |
| 2886 |
% name, because I don't know the abbreviated versions. |
| 2887 |
% \begin{macrocode} |
| 2888 |
\providecommand{\shortmonthnamecroatian}[1][\month]{% |
| 2889 |
\@orgargctr=#1\relax |
| 2890 |
\ifcase\@orgargctr |
| 2891 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2892 |
Month numbers should go from 1 (sijecnja) to 12 (prosinca)}% |
| 2893 |
\or sije\v{c}nja% |
| 2894 |
\or velja\v{c}e% |
| 2895 |
\or o\v{z}ujka% |
| 2896 |
\or travnja% |
| 2897 |
\or svibnja% |
| 2898 |
\or lipnja% |
| 2899 |
\or srpnja% |
| 2900 |
\or kolovoza% |
| 2901 |
\or rujna% |
| 2902 |
\or listopada% |
| 2903 |
\or studenoga% |
| 2904 |
\or prosinca% |
| 2905 |
\else |
| 2906 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2907 |
Month numbers should go from 1 (sijecnja) to 12 (prosinca)}% |
| 2908 |
\fi}% |
| 2909 |
\global\let\shortmonthnamecroatian\shortmonthnamecroatian |
| 2910 |
% \end{macrocode} |
| 2911 |
% Translations provided by Ivan Kokan: |
| 2912 |
% \begin{macrocode} |
| 2913 |
\providecommand*{\dayofweeknameidcroatian}[1]{% |
| 2914 |
\ifcase#1\relax |
| 2915 |
\or nedjelja% |
| 2916 |
\or ponedjeljak% |
| 2917 |
\or utorak% |
| 2918 |
\or srijeda% |
| 2919 |
\or \v{c}etvrtak% |
| 2920 |
\or petak% |
| 2921 |
\or subota% |
| 2922 |
\fi}% |
| 2923 |
\global\let\dayofweeknameidcroatian\dayofweeknameidcroatian |
| 2924 |
\providecommand*{\shortdayofweeknameidcroatian}[1]{% |
| 2925 |
\ifcase#1\relax |
| 2926 |
\or ned% |
| 2927 |
\or pon% |
| 2928 |
\or uto% |
| 2929 |
\or sri% |
| 2930 |
\or \v{c}et% |
| 2931 |
\or pet% |
| 2932 |
\or sub% |
| 2933 |
\fi}% |
| 2934 |
\global\let\shortdayofweeknameidcroatian\shortdayofweeknameidcroatian |
| 2935 |
% \end{macrocode} |
| 2936 |
% (Re)Define declaration to switch to this format. |
| 2937 |
% \begin{macrocode} |
| 2938 |
\DeclareRobustCommand*\datecroatian{% |
| 2939 |
\renewcommand{\formatdate}[3]{% |
| 2940 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 2941 |
\number\@day.~\monthnamecroatian[\@month]\space \number\@year.}}% |
| 2942 |
\global\let\datecroatian\datecroatian |
| 2943 |
% \end{macrocode} |
| 2944 |
%\iffalse |
| 2945 |
% \begin{macrocode} |
| 2946 |
%</dt-croatian.def> |
| 2947 |
% \end{macrocode} |
| 2948 |
%\fi |
| 2949 |
%\iffalse |
| 2950 |
% \begin{macrocode} |
| 2951 |
%<*dt-czech.def> |
| 2952 |
% \end{macrocode} |
| 2953 |
%\fi |
| 2954 |
%\subsubsection{Czech} |
| 2955 |
% Identify file |
| 2956 |
% \begin{macrocode} |
| 2957 |
\ProvidesFile{dt-czech.def}[2013/09/10]% |
| 2958 |
% \end{macrocode} |
| 2959 |
% Define month names. |
| 2960 |
% \begin{macrocode} |
| 2961 |
\providecommand{\monthnameczech}[1][\month]{% |
| 2962 |
\@orgargctr=#1\relax |
| 2963 |
\ifcase\@orgargctr |
| 2964 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2965 |
Month numbers should go from 1 to 12}% |
| 2966 |
\or ledna% |
| 2967 |
\or \'unora% |
| 2968 |
\or b\v{r}ezna% |
| 2969 |
\or dubna% |
| 2970 |
\or kv\v{e}tna% |
| 2971 |
\or \v{c}ervna% |
| 2972 |
\or \v{c}ervence% |
| 2973 |
\or srpna% |
| 2974 |
\or z\'a\v{r}\'{\i}% |
| 2975 |
\or \v{r}\'{\i}jna% |
| 2976 |
\or listopadu% |
| 2977 |
\or prosince% |
| 2978 |
\else |
| 2979 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2980 |
Month numbers should go from 1 to 12}% |
| 2981 |
\fi}% |
| 2982 |
\global\let\monthnameczech\monthnameczech |
| 2983 |
% \end{macrocode} |
| 2984 |
% Define abbreviated month names. This currently does the full |
| 2985 |
% name, because I don't know the abbreviated versions. |
| 2986 |
% \begin{macrocode} |
| 2987 |
\providecommand{\shortmonthnameczech}[1][\month]{% |
| 2988 |
\@orgargctr=#1\relax |
| 2989 |
\ifcase\@orgargctr |
| 2990 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 2991 |
Month numbers should go from 1 to 12}% |
| 2992 |
\or ledna% |
| 2993 |
\or \'unora% |
| 2994 |
\or b\v{r}ezna% |
| 2995 |
\or dubna% |
| 2996 |
\or kv\v{e}tna% |
| 2997 |
\or \v{c}ervna% |
| 2998 |
\or \v{c}ervence% |
| 2999 |
\or srpna% |
| 3000 |
\or z\'a\v{r}\'{\i}% |
| 3001 |
\or \v{r}\'{\i}jna% |
| 3002 |
\or listopadu% |
| 3003 |
\or prosince% |
| 3004 |
\else |
| 3005 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3006 |
Month numbers should go from 1 to 12}% |
| 3007 |
\fi}% |
| 3008 |
\global\let\shortmonthnameczech\shortmonthnameczech |
| 3009 |
% \end{macrocode} |
| 3010 |
% (Re)Define declaration to switch to this format. |
| 3011 |
% \begin{macrocode} |
| 3012 |
\DeclareRobustCommand*\dateczech{% |
| 3013 |
\renewcommand{\formatdate}[3]{% |
| 3014 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3015 |
\number\@day.~\monthnameczech[\@month]\space \number\@year}}% |
| 3016 |
\global\let\dateczech\dateczech |
| 3017 |
% \end{macrocode} |
| 3018 |
%\iffalse |
| 3019 |
% \begin{macrocode} |
| 3020 |
%</dt-czech.def> |
| 3021 |
% \end{macrocode} |
| 3022 |
%\fi |
| 3023 |
%\iffalse |
| 3024 |
% \begin{macrocode} |
| 3025 |
%<*dt-danish.def> |
| 3026 |
% \end{macrocode} |
| 3027 |
%\fi |
| 3028 |
%\subsubsection{Danish} |
| 3029 |
% Identify file |
| 3030 |
% \begin{macrocode} |
| 3031 |
\ProvidesFile{dt-danish.def}[2013/09/10]% |
| 3032 |
% \end{macrocode} |
| 3033 |
% Define month names. |
| 3034 |
% \begin{macrocode} |
| 3035 |
\providecommand{\monthnamedanish}[1][\month]{% |
| 3036 |
\@orgargctr=#1\relax |
| 3037 |
\ifcase\@orgargctr |
| 3038 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3039 |
Month numbers should go from 1 to 12}% |
| 3040 |
\or januar% |
| 3041 |
\or februar% |
| 3042 |
\or marts% |
| 3043 |
\or april% |
| 3044 |
\or maj% |
| 3045 |
\or juni% |
| 3046 |
\or juli% |
| 3047 |
\or august% |
| 3048 |
\or september% |
| 3049 |
\or oktober% |
| 3050 |
\or november% |
| 3051 |
\or december% |
| 3052 |
\else |
| 3053 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3054 |
Month numbers should go from 1 to 12}% |
| 3055 |
\fi}% |
| 3056 |
\global\let\monthnamedanish\monthnamedanish |
| 3057 |
% \end{macrocode} |
| 3058 |
% (Re)Define declaration to switch to this format. |
| 3059 |
% \begin{macrocode} |
| 3060 |
\DeclareRobustCommand*\datedanish{% |
| 3061 |
\renewcommand{\formatdate}[3]{% |
| 3062 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3063 |
\number\@day.~\monthnamedanish[\@month]\space \number\@year}}% |
| 3064 |
\global\let\datedanish\datedanish |
| 3065 |
% \end{macrocode} |
| 3066 |
%\iffalse |
| 3067 |
% \begin{macrocode} |
| 3068 |
%</dt-danish.def> |
| 3069 |
% \end{macrocode} |
| 3070 |
%\fi |
| 3071 |
%\iffalse |
| 3072 |
% \begin{macrocode} |
| 3073 |
%<*dt-dutch.def> |
| 3074 |
% \end{macrocode} |
| 3075 |
%\fi |
| 3076 |
%\subsubsection{Dutch} |
| 3077 |
% Identify file |
| 3078 |
% \begin{macrocode} |
| 3079 |
\ProvidesFile{dt-dutch.def}[2015/03/20]% |
| 3080 |
% \end{macrocode} |
| 3081 |
% Define month names. |
| 3082 |
% \begin{macrocode} |
| 3083 |
\providecommand{\monthnamedutch}[1][\month]{% |
| 3084 |
\@orgargctr=#1\relax |
| 3085 |
\ifcase\@orgargctr |
| 3086 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3087 |
Month numbers should go from 1 to 12}% |
| 3088 |
\or januari% |
| 3089 |
\or februari% |
| 3090 |
\or maart% |
| 3091 |
\or april% |
| 3092 |
\or mei% |
| 3093 |
\or juni% |
| 3094 |
\or juli% |
| 3095 |
\or augustus% |
| 3096 |
\or september% |
| 3097 |
\or oktober% |
| 3098 |
\or november% |
| 3099 |
\or december% |
| 3100 |
\else |
| 3101 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3102 |
Month numbers should go from 1 to 12}% |
| 3103 |
\fi}% |
| 3104 |
\global\let\monthnamedutch\monthnamedutch |
| 3105 |
% \end{macrocode} |
| 3106 |
% (Re)Define declaration to switch to this format. |
| 3107 |
% \begin{macrocode} |
| 3108 |
\DeclareRobustCommand*\datedutch{% |
| 3109 |
\renewcommand{\formatdate}[3]{% |
| 3110 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3111 |
\number\@day~\monthnamedutch[\@month]\space \number\@year}}% |
| 3112 |
\global\let\datedutch\datedutch |
| 3113 |
% \end{macrocode} |
| 3114 |
% Day of week name provided by multiple people. |
| 3115 |
% \begin{macrocode} |
| 3116 |
\providecommand*{\dayofweeknameiddutch}[1]{% |
| 3117 |
\ifcase#1\relax |
| 3118 |
\or zondag% |
| 3119 |
\or maandag% |
| 3120 |
\or dinsdag% |
| 3121 |
\or woensdag% |
| 3122 |
\or donderdag% |
| 3123 |
\or vrijdag% |
| 3124 |
\or zaterdag% |
| 3125 |
\fi} |
| 3126 |
|
| 3127 |
\providecommand*{\shortdayofweeknameiddutch}[1]{% |
| 3128 |
\ifcase#1\relax |
| 3129 |
\or zo% |
| 3130 |
\or ma% |
| 3131 |
\or di% |
| 3132 |
\or wo% |
| 3133 |
\or do% |
| 3134 |
\or vr% |
| 3135 |
\or za% |
| 3136 |
\fi} |
| 3137 |
% \end{macrocode} |
| 3138 |
%\iffalse |
| 3139 |
% \begin{macrocode} |
| 3140 |
%</dt-dutch.def> |
| 3141 |
% \end{macrocode} |
| 3142 |
%\fi |
| 3143 |
%\iffalse |
| 3144 |
% \begin{macrocode} |
| 3145 |
%<*dt-esperanto.def> |
| 3146 |
% \end{macrocode} |
| 3147 |
%\fi |
| 3148 |
%\subsubsection{Esperanto} |
| 3149 |
% Identify file |
| 3150 |
% \begin{macrocode} |
| 3151 |
\ProvidesFile{dt-esperanto.def}[2013/09/10]% |
| 3152 |
% \end{macrocode} |
| 3153 |
% Define month names. |
| 3154 |
% \begin{macrocode} |
| 3155 |
\providecommand{\monthnameesperanto}[1][\month]{% |
| 3156 |
\@orgargctr=#1\relax |
| 3157 |
\ifcase\@orgargctr |
| 3158 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3159 |
Month numbers should go from 1 to 12}% |
| 3160 |
\or januaro% |
| 3161 |
\or februaro% |
| 3162 |
\or marto% |
| 3163 |
\or aprilo% |
| 3164 |
\or majo% |
| 3165 |
\or junio% |
| 3166 |
\or julio% |
| 3167 |
\or a\u{u}gusto% |
| 3168 |
\or septembro% |
| 3169 |
\or oktobro% |
| 3170 |
\or novembro% |
| 3171 |
\or decembro% |
| 3172 |
\else |
| 3173 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3174 |
Month numbers should go from 1 to 12}% |
| 3175 |
\fi}% |
| 3176 |
\global\let\monthnameesperanto\monthnameesperanto |
| 3177 |
% \end{macrocode} |
| 3178 |
% (Re)Define declaration to switch to this format. |
| 3179 |
% \begin{macrocode} |
| 3180 |
\DeclareRobustCommand*\dateesperanto{% |
| 3181 |
\renewcommand{\formatdate}[3]{% |
| 3182 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3183 |
\number\@day{--a}~de~\monthnameesperanto[\@month],\space |
| 3184 |
\number\@year}}% |
| 3185 |
\global\let\dateesperanto\dateesperanto |
| 3186 |
% \end{macrocode} |
| 3187 |
%\iffalse |
| 3188 |
% \begin{macrocode} |
| 3189 |
%</dt-esperanto.def> |
| 3190 |
% \end{macrocode} |
| 3191 |
%\fi |
| 3192 |
%\iffalse |
| 3193 |
% \begin{macrocode} |
| 3194 |
%<*dt-estonian.def> |
| 3195 |
% \end{macrocode} |
| 3196 |
%\fi |
| 3197 |
%\subsubsection{Estonian} |
| 3198 |
% Identify file |
| 3199 |
% \begin{macrocode} |
| 3200 |
\ProvidesFile{dt-estonian.def}[2013/09/10]% |
| 3201 |
% \end{macrocode} |
| 3202 |
% Define month names. |
| 3203 |
% \begin{macrocode} |
| 3204 |
\providecommand{\monthnameestonian}[1][\month]{% |
| 3205 |
\@orgargctr=#1\relax |
| 3206 |
\ifcase\@orgargctr |
| 3207 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3208 |
Month numbers should go from 1 to 12}% |
| 3209 |
\or jaanuar% |
| 3210 |
\or veebruar% |
| 3211 |
\or m"arts% |
| 3212 |
\or aprill% |
| 3213 |
\or mai% |
| 3214 |
\or juuni% |
| 3215 |
\or juuli% |
| 3216 |
\or august% |
| 3217 |
\or september% |
| 3218 |
\or oktoober% |
| 3219 |
\or november% |
| 3220 |
\or detsember% |
| 3221 |
\else |
| 3222 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3223 |
Month numbers should go from 1 to 12}% |
| 3224 |
\fi}% |
| 3225 |
\global\let\monthnameestonian\monthnameestonian |
| 3226 |
% \end{macrocode} |
| 3227 |
% (Re)Define declaration to switch to this format. |
| 3228 |
% \begin{macrocode} |
| 3229 |
\DeclareRobustCommand*\dateestonian{% |
| 3230 |
\renewcommand{\formatdate}[3]{% |
| 3231 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3232 |
\number\@day.\space\monthnameestonian[\@month]\space |
| 3233 |
\number\@year.\space a.}}% |
| 3234 |
\global\let\dateestonian\dateestonian |
| 3235 |
% \end{macrocode} |
| 3236 |
%\iffalse |
| 3237 |
% \begin{macrocode} |
| 3238 |
%</dt-estonian.def> |
| 3239 |
% \end{macrocode} |
| 3240 |
%\fi |
| 3241 |
%\iffalse |
| 3242 |
% \begin{macrocode} |
| 3243 |
%<*dt-finnish.def> |
| 3244 |
% \end{macrocode} |
| 3245 |
%\fi |
| 3246 |
%\subsubsection{Finnish} |
| 3247 |
% Identify file |
| 3248 |
% \begin{macrocode} |
| 3249 |
\ProvidesFile{dt-finnish.def}[2013/09/10]% |
| 3250 |
% \end{macrocode} |
| 3251 |
% Define month names. |
| 3252 |
% \begin{macrocode} |
| 3253 |
\providecommand{\monthnamefinnish}[1][\month]{% |
| 3254 |
\@orgargctr=#1\relax |
| 3255 |
\ifcase\@orgargctr |
| 3256 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3257 |
Month numbers should go from 1 to 12}% |
| 3258 |
\or tammikuuta% |
| 3259 |
\or helmikuuta% |
| 3260 |
\or maaliskuuta% |
| 3261 |
\or huhtikuuta% |
| 3262 |
\or toukokuuta% |
| 3263 |
\or kes\"akuuta% |
| 3264 |
\or hein\"akuuta% |
| 3265 |
\or elokuuta% |
| 3266 |
\or syyskuuta% |
| 3267 |
\or lokakuuta% |
| 3268 |
\or marraskuuta% |
| 3269 |
\or joulukuuta% |
| 3270 |
\else |
| 3271 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3272 |
Month numbers should go from 1 to 12}% |
| 3273 |
\fi}% |
| 3274 |
\global\let\monthnamefinnish\monthnamefinnish |
| 3275 |
% \end{macrocode} |
| 3276 |
% (Re)Define declaration to switch to this format. |
| 3277 |
% \begin{macrocode} |
| 3278 |
\DeclareRobustCommand*\datefinnish{% |
| 3279 |
\renewcommand{\formatdate}[3]{% |
| 3280 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3281 |
\number\@day.~\monthnamefinnish[\@month]\space \number\@year}}% |
| 3282 |
\global\let\datefinnish\datefinnish |
| 3283 |
% \end{macrocode} |
| 3284 |
%\iffalse |
| 3285 |
% \begin{macrocode} |
| 3286 |
%</dt-finnish.def> |
| 3287 |
% \end{macrocode} |
| 3288 |
%\fi |
| 3289 |
%\iffalse |
| 3290 |
% \begin{macrocode} |
| 3291 |
%<*dt-french.def> |
| 3292 |
% \end{macrocode} |
| 3293 |
%\fi |
| 3294 |
%\subsubsection{French} |
| 3295 |
% Identify file |
| 3296 |
% \begin{macrocode} |
| 3297 |
\ProvidesFile{dt-french.def}[2013/09/10]% |
| 3298 |
% \end{macrocode} |
| 3299 |
%\begin{macro}{\ordinaldatefrench} |
| 3300 |
% French: |
| 3301 |
% \begin{macrocode} |
| 3302 |
\providecommand*{\ordinaldatefrench}[1]{% |
| 3303 |
#1\ifnum#1=1\ier\fi}% |
| 3304 |
\global\let\ordinaldatefrench\ordinaldatefrench |
| 3305 |
% \end{macrocode} |
| 3306 |
%\end{macro} |
| 3307 |
%\begin{macro}{\ier} |
| 3308 |
% In case \verb|\ier| hasn't been defined:% |
| 3309 |
%\changes{v2.47}{27 Oct 2005}{defined if it doesn't |
| 3310 |
% already exist} |
| 3311 |
% \begin{macrocode} |
| 3312 |
\providecommand*{\ier}{\textsuperscript{er}}% |
| 3313 |
\global\let\ier\ier |
| 3314 |
% \end{macrocode} |
| 3315 |
%\end{macro} |
| 3316 |
% Define week day names. |
| 3317 |
% \begin{macrocode} |
| 3318 |
\providecommand{\dayofweeknameidfrench}[1]{% |
| 3319 |
\ifcase#1\relax |
| 3320 |
\or dimanche% |
| 3321 |
\or lundi% |
| 3322 |
\or mardi% |
| 3323 |
\or mercredi% |
| 3324 |
\or jeudi% |
| 3325 |
\or vendredi% |
| 3326 |
\or samedi% |
| 3327 |
\fi}% |
| 3328 |
\global\let\dayofweeknameidfrench\dayofweeknameidfrench |
| 3329 |
% \end{macrocode} |
| 3330 |
% Define abbreviated week day names (are these correct?) |
| 3331 |
% \begin{macrocode} |
| 3332 |
\providecommand{\shortdayofweeknameidfrench}[1]{% |
| 3333 |
\ifcase#1\relax |
| 3334 |
\or dim% |
| 3335 |
\or lun% |
| 3336 |
\or mar% |
| 3337 |
\or mer% |
| 3338 |
\or jeu% |
| 3339 |
\or ven% |
| 3340 |
\or sam% |
| 3341 |
\fi}% |
| 3342 |
\global\let\shortdayofweeknameidfrench\shortdayofweeknameidfrench |
| 3343 |
% \end{macrocode} |
| 3344 |
% Define month names. |
| 3345 |
% \begin{macrocode} |
| 3346 |
\providecommand{\monthnamefrench}[1][\month]{% |
| 3347 |
\@orgargctr=#1\relax |
| 3348 |
\ifcase\@orgargctr |
| 3349 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3350 |
Month numbers should go from 1 (janvier) to 12 (decembre)}% |
| 3351 |
\or janvier% |
| 3352 |
\or f\'evrier% |
| 3353 |
\or mars% |
| 3354 |
\or avril% |
| 3355 |
\or mai% |
| 3356 |
\or juin% |
| 3357 |
\or juillet% |
| 3358 |
\or ao\^ut% |
| 3359 |
\or septembre% |
| 3360 |
\or octobre% |
| 3361 |
\or novembre% |
| 3362 |
\or d\'ecembre% |
| 3363 |
\else |
| 3364 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3365 |
Month numbers should go from 1 (janvier) to 12 (decembre)}% |
| 3366 |
\fi}% |
| 3367 |
\global\let\monthnamefrench\monthnamefrench |
| 3368 |
% \end{macrocode} |
| 3369 |
% (Re)Define declaration to switch to this format. |
| 3370 |
% \begin{macrocode} |
| 3371 |
\DeclareRobustCommand*\datefrench{% |
| 3372 |
\renewcommand{\formatdate}[3]{% |
| 3373 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3374 |
\number\@day\ifnum\@day=1{\ier}\fi\space |
| 3375 |
\monthnamefrench[\@month]\space \number\@year}}% |
| 3376 |
\global\let\datefrench\datefrench |
| 3377 |
% \end{macrocode} |
| 3378 |
% Short month names provided by Rapha\"el Pinson |
| 3379 |
% \begin{macrocode} |
| 3380 |
\providecommand{\shortmonthnamefrench}[1][\month]{% |
| 3381 |
\@orgargctr=#1\relax |
| 3382 |
\ifcase\@orgargctr |
| 3383 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3384 |
Month numbers should go from 1 (jan.) to 12 (dec.)}% |
| 3385 |
\or jan.% |
| 3386 |
\or f\'evr.% |
| 3387 |
\or mars% |
| 3388 |
\or avr.% |
| 3389 |
\or mai% |
| 3390 |
\or juin% |
| 3391 |
\or juill.% |
| 3392 |
\or ao\^ut% |
| 3393 |
\or sept.% |
| 3394 |
\or oct.% |
| 3395 |
\or nov.% |
| 3396 |
\or d\'ec.% |
| 3397 |
\else |
| 3398 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3399 |
Month numbers should go from 1 (jan.) to 12 (dec.)}% |
| 3400 |
\fi} |
| 3401 |
% \end{macrocode} |
| 3402 |
%\iffalse |
| 3403 |
% \begin{macrocode} |
| 3404 |
%</dt-french.def> |
| 3405 |
% \end{macrocode} |
| 3406 |
%\fi |
| 3407 |
%\iffalse |
| 3408 |
% \begin{macrocode} |
| 3409 |
%<*dt-galician.def> |
| 3410 |
% \end{macrocode} |
| 3411 |
%\fi |
| 3412 |
%\subsubsection{Galician} |
| 3413 |
% Identify file |
| 3414 |
% \begin{macrocode} |
| 3415 |
\ProvidesFile{dt-galician.def}[2013/09/10]% |
| 3416 |
% \end{macrocode} |
| 3417 |
% Define month names. |
| 3418 |
% \begin{macrocode} |
| 3419 |
\providecommand{\monthnamegalician}[1][\month]{% |
| 3420 |
\@orgargctr=#1\relax |
| 3421 |
\ifcase\@orgargctr |
| 3422 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3423 |
Month numbers should go from 1 to 12}% |
| 3424 |
\or xaneiro% |
| 3425 |
\or febreiro% |
| 3426 |
\or marzo% |
| 3427 |
\or abril% |
| 3428 |
\or maio% |
| 3429 |
\or xu\~no% |
| 3430 |
\or xullo% |
| 3431 |
\or agosto% |
| 3432 |
\or setembro% |
| 3433 |
\or outubro% |
| 3434 |
\or novembro% |
| 3435 |
\or decembro% |
| 3436 |
\else |
| 3437 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3438 |
Month numbers should go from 1 to 12}% |
| 3439 |
\fi}% |
| 3440 |
\global\let\monthnamegalician\monthnamegalician |
| 3441 |
% \end{macrocode} |
| 3442 |
% (Re)Define declaration to switch to this format. |
| 3443 |
% \begin{macrocode} |
| 3444 |
\DeclareRobustCommand*\dategalician{% |
| 3445 |
\renewcommand{\formatdate}[3]{% |
| 3446 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3447 |
\number\@day~de\space\monthnamegalician[\@month]\space |
| 3448 |
de~\number\@year}}% |
| 3449 |
\global\let\dategalician\dategalician |
| 3450 |
% \end{macrocode} |
| 3451 |
%\iffalse |
| 3452 |
% \begin{macrocode} |
| 3453 |
%</dt-galician.def> |
| 3454 |
% \end{macrocode} |
| 3455 |
%\fi |
| 3456 |
%\iffalse |
| 3457 |
% \begin{macrocode} |
| 3458 |
%<*dt-german.def> |
| 3459 |
% \end{macrocode} |
| 3460 |
%\fi |
| 3461 |
%\subsubsection{German} |
| 3462 |
% Identify file |
| 3463 |
% \begin{macrocode} |
| 3464 |
\ProvidesFile{dt-german.def}[2010/09/10]% |
| 3465 |
% \end{macrocode} |
| 3466 |
% Define month names. |
| 3467 |
% \begin{macrocode} |
| 3468 |
\providecommand{\monthnamegerman}[1][\month]{% |
| 3469 |
\@orgargctr=#1\relax |
| 3470 |
\ifcase\@orgargctr |
| 3471 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3472 |
Month numbers should go from 1 to 12}% |
| 3473 |
\or Januar% |
| 3474 |
\or Februar% |
| 3475 |
\or M\"arz% |
| 3476 |
\or April% |
| 3477 |
\or Mai% |
| 3478 |
\or Juni% |
| 3479 |
\or Juli% |
| 3480 |
\or August% |
| 3481 |
\or September% |
| 3482 |
\or Oktober% |
| 3483 |
\or November% |
| 3484 |
\or Dezember% |
| 3485 |
\else |
| 3486 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3487 |
Month numbers should go from 1 (janvier) to 12 (decembre)}% |
| 3488 |
\fi}% |
| 3489 |
\global\let\monthnamegerman\monthnamegerman |
| 3490 |
% \end{macrocode} |
| 3491 |
% The following week day names were supplied by Uwe Bieling: |
| 3492 |
% \begin{macrocode} |
| 3493 |
\providecommand{\dayofweeknameidgerman}[1]{% |
| 3494 |
\ifcase#1\relax |
| 3495 |
\or Sonntag% |
| 3496 |
\or Montag% |
| 3497 |
\or Dienstag% |
| 3498 |
\or Mittwoch% |
| 3499 |
\or Donnerstag% |
| 3500 |
\or Freitag% |
| 3501 |
\or Samstag% |
| 3502 |
\fi}% |
| 3503 |
\global\let\dayofweeknameidgerman\dayofweeknameidgerman |
| 3504 |
% \end{macrocode} |
| 3505 |
% \begin{macrocode} |
| 3506 |
\providecommand{\shortdayofweeknameidgerman}[1]{% |
| 3507 |
\ifcase#1\relax |
| 3508 |
\or So% |
| 3509 |
\or Mo% |
| 3510 |
\or Di% |
| 3511 |
\or Mi% |
| 3512 |
\or Do% |
| 3513 |
\or Fr% |
| 3514 |
\or Sa% |
| 3515 |
\fi}% |
| 3516 |
\global\let\shortdayofweeknameidgerman\shortdayofweeknameidgerman |
| 3517 |
% \end{macrocode} |
| 3518 |
% (Re)Define declaration to switch to this format. |
| 3519 |
% \begin{macrocode} |
| 3520 |
\DeclareRobustCommand*\dategerman{% |
| 3521 |
\renewcommand{\formatdate}[3]{% |
| 3522 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3523 |
\number\@day.~\monthnamegerman[\@month]\space\number\@year}}% |
| 3524 |
\global\let\dategerman\dategerman |
| 3525 |
% \end{macrocode} |
| 3526 |
%\iffalse |
| 3527 |
% \begin{macrocode} |
| 3528 |
%</dt-german.def> |
| 3529 |
% \end{macrocode} |
| 3530 |
%\fi |
| 3531 |
%\iffalse |
| 3532 |
% \begin{macrocode} |
| 3533 |
%<*dt-greek.def> |
| 3534 |
% \end{macrocode} |
| 3535 |
%\fi |
| 3536 |
%\subsubsection{Greek} |
| 3537 |
% Identify file |
| 3538 |
% \begin{macrocode} |
| 3539 |
\ProvidesFile{dt-greek.def}[2013/09/10]% |
| 3540 |
% \end{macrocode} |
| 3541 |
% Define month names. |
| 3542 |
% \begin{macrocode} |
| 3543 |
\providecommand{\monthnamegreek}[1][\month]{% |
| 3544 |
\@orgargctr=#1\relax |
| 3545 |
\ifcase\@orgargctr |
| 3546 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3547 |
Month numbers should go from 1 to 12}% |
| 3548 |
\or Ianouar'iou% |
| 3549 |
\or Febrouar'iou% |
| 3550 |
\or Mart'iou% |
| 3551 |
\or April'iou% |
| 3552 |
\or Ma'"iou% |
| 3553 |
\or Ioun'iou% |
| 3554 |
\or Ioul'iou% |
| 3555 |
\or Augo'ustou% |
| 3556 |
\or Septembr'iou% |
| 3557 |
\or Oktwbr'iou% |
| 3558 |
\or Noembr'iou% |
| 3559 |
\or Dekembr'iou% |
| 3560 |
\else |
| 3561 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3562 |
Month numbers should go from 1 to 12}% |
| 3563 |
\fi}% |
| 3564 |
\global\let\monthnamegreek\monthnamegreek |
| 3565 |
% \end{macrocode} |
| 3566 |
% (Re)Define declaration to switch to this format. |
| 3567 |
% \begin{macrocode} |
| 3568 |
\DeclareRobustCommand*\dategreek{% |
| 3569 |
\renewcommand{\formatdate}[3]{% |
| 3570 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3571 |
\number\@day\space\monthnamegreek[\@month]\space\number\@year}}% |
| 3572 |
\global\let\dategreek\dategreek |
| 3573 |
% \end{macrocode} |
| 3574 |
%\iffalse |
| 3575 |
% \begin{macrocode} |
| 3576 |
%</dt-greek.def> |
| 3577 |
% \end{macrocode} |
| 3578 |
%\fi |
| 3579 |
%\iffalse |
| 3580 |
% \begin{macrocode} |
| 3581 |
%<*dt-hebrew.def> |
| 3582 |
% \end{macrocode} |
| 3583 |
%\fi |
| 3584 |
%\subsubsection{Hebrew} |
| 3585 |
% Identify file |
| 3586 |
% \begin{macrocode} |
| 3587 |
\ProvidesFile{dt-hebrew.def}[2013/09/10]% |
| 3588 |
% \end{macrocode} |
| 3589 |
% Babel already provides Hebrew month names, so just provide a |
| 3590 |
% synonym. |
| 3591 |
% \begin{macrocode} |
| 3592 |
\global\let\monthnamehebrew\hebmonth |
| 3593 |
% \end{macrocode} |
| 3594 |
% Redefine declaration to switch to this format. (This uses |
| 3595 |
% |\hebdate| which is defined by babel.) |
| 3596 |
% \begin{macrocode} |
| 3597 |
\DeclareRobustCommand*\datehebrew{% |
| 3598 |
\renewcommand{\formatdate}[3]{% |
| 3599 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3600 |
\hebdate\@day\@month\@year}}% |
| 3601 |
\global\let\datehebrew\datehebrew |
| 3602 |
% \end{macrocode} |
| 3603 |
%\iffalse |
| 3604 |
% \begin{macrocode} |
| 3605 |
%</dt-hebrew.def> |
| 3606 |
% \end{macrocode} |
| 3607 |
%\fi |
| 3608 |
%\iffalse |
| 3609 |
% \begin{macrocode} |
| 3610 |
%<*dt-icelandic.def> |
| 3611 |
% \end{macrocode} |
| 3612 |
%\fi |
| 3613 |
%\subsubsection{Icelandic} |
| 3614 |
% Identify file |
| 3615 |
% \begin{macrocode} |
| 3616 |
\ProvidesFile{dt-icelandic.def}[2013/09/10]% |
| 3617 |
% \end{macrocode} |
| 3618 |
% Define month names. |
| 3619 |
% \begin{macrocode} |
| 3620 |
\providecommand{\monthnameicelandic}[1][\month]{% |
| 3621 |
\@orgargctr=#1\relax |
| 3622 |
\ifcase\@orgargctr |
| 3623 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3624 |
Month numbers should go from 1 to 12}% |
| 3625 |
\or jan\'uar% |
| 3626 |
\or febr\'uar% |
| 3627 |
\or mars% |
| 3628 |
\or apr\'il% |
| 3629 |
\or ma\'i% |
| 3630 |
\or j\'un\'i% |
| 3631 |
\or j\'ul\'i% |
| 3632 |
\or \'ag\'ust% |
| 3633 |
\or september% |
| 3634 |
\or okt\'ober% |
| 3635 |
\or n\'ovember% |
| 3636 |
\or desembe% |
| 3637 |
\else |
| 3638 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3639 |
Month numbers should go from 1 to 12}% |
| 3640 |
\fi}% |
| 3641 |
\global\let\monthnameicelandic\monthnameicelandic |
| 3642 |
% \end{macrocode} |
| 3643 |
% (Re)Define declaration to switch to this format. |
| 3644 |
% \begin{macrocode} |
| 3645 |
\DeclareRobustCommand*\dateicelandic{% |
| 3646 |
\renewcommand{\formatdate}[3]{% |
| 3647 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3648 |
\number\@day.~\monthnameicelandic[\@month]\space\number\@year}}% |
| 3649 |
\global\let\dateicelandic\dateicelandic |
| 3650 |
% \end{macrocode} |
| 3651 |
%\iffalse |
| 3652 |
% \begin{macrocode} |
| 3653 |
%</dt-icelandic.def> |
| 3654 |
% \end{macrocode} |
| 3655 |
%\fi |
| 3656 |
%\iffalse |
| 3657 |
% \begin{macrocode} |
| 3658 |
%<*dt-irish.def> |
| 3659 |
% \end{macrocode} |
| 3660 |
%\fi |
| 3661 |
%\subsubsection{Irish} |
| 3662 |
% Identify file |
| 3663 |
% \begin{macrocode} |
| 3664 |
\ProvidesFile{dt-irish.def}[2013/09/10]% |
| 3665 |
% \end{macrocode} |
| 3666 |
% Define month names. |
| 3667 |
% \begin{macrocode} |
| 3668 |
\providecommand{\monthnameirish}[1][\month]{% |
| 3669 |
\@orgargctr=#1\relax |
| 3670 |
\ifcase\@orgargctr |
| 3671 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3672 |
Month numbers should go from 1 to 12}% |
| 3673 |
\or Ean\'air% |
| 3674 |
\or Feabhra% |
| 3675 |
\or M\'arta% |
| 3676 |
\or Aibre\'an% |
| 3677 |
\or Bealtaine% |
| 3678 |
\or Meitheamh% |
| 3679 |
\or I\'uil% |
| 3680 |
\or L\'unasa% |
| 3681 |
\or Me\'an F\'omhair% |
| 3682 |
\or Deireadh F\'omhair% |
| 3683 |
\or M\'{\i} na Samhna% |
| 3684 |
\or M\'{\i} na Nollag% |
| 3685 |
\else |
| 3686 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3687 |
Month numbers should go from 1 to 12}% |
| 3688 |
\fi}% |
| 3689 |
\global\let\monthnameirish\monthnameirish |
| 3690 |
% \end{macrocode} |
| 3691 |
% (Re)Define declaration to switch to this format. |
| 3692 |
% \begin{macrocode} |
| 3693 |
\DeclareRobustCommand*\dateirish{% |
| 3694 |
\renewcommand{\formatdate}[3]{% |
| 3695 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3696 |
\number\@day\space\monthnameirish[\@month]\space\number\@year}}% |
| 3697 |
\global\let\dateirish\dateirish |
| 3698 |
% \end{macrocode} |
| 3699 |
%\iffalse |
| 3700 |
% \begin{macrocode} |
| 3701 |
%</dt-irish.def> |
| 3702 |
% \end{macrocode} |
| 3703 |
%\fi |
| 3704 |
%\iffalse |
| 3705 |
% \begin{macrocode} |
| 3706 |
%<*dt-italian.def> |
| 3707 |
% \end{macrocode} |
| 3708 |
%\fi |
| 3709 |
%\subsubsection{Italian} |
| 3710 |
% \begin{macrocode} |
| 3711 |
\ProvidesFile{dt-italian.def}[2015/03/20]% |
| 3712 |
% \end{macrocode} |
| 3713 |
% Translations provided by Giada Ermacora and Marco Coppola |
| 3714 |
% \begin{macrocode} |
| 3715 |
\providecommand{\dayofweeknameiditalian}[1]{% |
| 3716 |
\ifcase#1\relax |
| 3717 |
\or domenica% |
| 3718 |
\or luned\`{\i}% |
| 3719 |
\or marted\`{\i}% |
| 3720 |
\or mercoled\`{\i}% |
| 3721 |
\or gioved\`{\i}% |
| 3722 |
\or venerd\`{\i}% |
| 3723 |
\or sabato% |
| 3724 |
\fi}% |
| 3725 |
\global\let\dayofweeknameiditalian\dayofweeknameiditalian |
| 3726 |
% \end{macrocode} |
| 3727 |
% \begin{macrocode} |
| 3728 |
\providecommand{\shortdayofweeknameiditalian}[1]{% |
| 3729 |
\ifcase#1\relax |
| 3730 |
\or dom% |
| 3731 |
\or lun% |
| 3732 |
\or mar% |
| 3733 |
\or mer% |
| 3734 |
\or gio% |
| 3735 |
\or ven% |
| 3736 |
\or sab% |
| 3737 |
\fi}% |
| 3738 |
\global\let\shortdayofweeknameiditalian\shortdayofweeknameiditalian |
| 3739 |
% \end{macrocode} |
| 3740 |
% \begin{macrocode} |
| 3741 |
\providecommand{\monthnameitalian}[1][\month]{% |
| 3742 |
\@orgargctr=#1\relax |
| 3743 |
\ifcase\@orgargctr |
| 3744 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gennaio) to 12 (dicembre)}% |
| 3745 |
\or gennaio% |
| 3746 |
\or febbraio% |
| 3747 |
\or marzo% |
| 3748 |
\or aprile% |
| 3749 |
\or maggio% |
| 3750 |
\or giugno% |
| 3751 |
\or luglio% |
| 3752 |
\or agosto% |
| 3753 |
\or settembre% |
| 3754 |
\or ottobre% |
| 3755 |
\or novembre% |
| 3756 |
\or dicembre% |
| 3757 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gennaio) to 12 (dicembre)}% |
| 3758 |
\fi}% |
| 3759 |
\global\let\monthnameitalian\monthnameitalian |
| 3760 |
% \end{macrocode} |
| 3761 |
% \begin{macrocode} |
| 3762 |
\providecommand{\shortmonthnameitalian}[1][\month]{% |
| 3763 |
\@orgargctr=#1\relax |
| 3764 |
\ifcase\@orgargctr |
| 3765 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gen) to 12 (dic)}% |
| 3766 |
\or gen% |
| 3767 |
\or feb% |
| 3768 |
\or mar% |
| 3769 |
\or apr% |
| 3770 |
\or mag% |
| 3771 |
\or giu% |
| 3772 |
\or lug% |
| 3773 |
\or ago% |
| 3774 |
\or set% |
| 3775 |
\or ott% |
| 3776 |
\or nov% |
| 3777 |
\or dic% |
| 3778 |
\else% |
| 3779 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gen) to 12 (dic)}% |
| 3780 |
\fi}% |
| 3781 |
\global\let\shortmonthnameitalian\shortmonthnameitalian |
| 3782 |
% \end{macrocode} |
| 3783 |
% \begin{macrocode} |
| 3784 |
\DeclareRobustCommand*\dateitalian{% |
| 3785 |
\renewcommand{\formatdate}[3]{% |
| 3786 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3787 |
\number\@day\space\monthnameitalian[\@month]\space\number\@year}}% |
| 3788 |
\global\let\dateitalian\dateitalian |
| 3789 |
% \end{macrocode} |
| 3790 |
%\iffalse |
| 3791 |
% \begin{macrocode} |
| 3792 |
%</dt-italian.def> |
| 3793 |
% \end{macrocode} |
| 3794 |
%\fi |
| 3795 |
%\iffalse |
| 3796 |
% \begin{macrocode} |
| 3797 |
%<*dt-latin.def> |
| 3798 |
% \end{macrocode} |
| 3799 |
%\fi |
| 3800 |
%\subsubsection{Latin} |
| 3801 |
% Identify file |
| 3802 |
% \begin{macrocode} |
| 3803 |
\ProvidesFile{dt-latin.def}[2013/09/10]% |
| 3804 |
% \end{macrocode} |
| 3805 |
% Define month names. |
| 3806 |
% \begin{macrocode} |
| 3807 |
\providecommand{\monthnamelatin}[1][\month]{% |
| 3808 |
\@orgargctr=#1\relax |
| 3809 |
\ifcase\@orgargctr |
| 3810 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3811 |
Month numbers should go from 1 to 12}% |
| 3812 |
\or Ianuarii% |
| 3813 |
\or Februarii% |
| 3814 |
\or Martii% |
| 3815 |
\or Aprilis% |
| 3816 |
\or Maii% |
| 3817 |
\or Iunii% |
| 3818 |
\or Iulii% |
| 3819 |
\or Augusti% |
| 3820 |
\or Septembris% |
| 3821 |
\or Octobris% |
| 3822 |
\or Novembris% |
| 3823 |
\or Decembris% |
| 3824 |
\else |
| 3825 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3826 |
Month numbers should go from 1 to 12}% |
| 3827 |
\fi}% |
| 3828 |
\global\let\monthnamelatin\monthnamelatin |
| 3829 |
% \end{macrocode} |
| 3830 |
% (Re)Define declaration to switch to this format. |
| 3831 |
% \begin{macrocode} |
| 3832 |
\DeclareRobustCommand*\datelatin{% |
| 3833 |
\renewcommand{\formatdate}[3]{% |
| 3834 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3835 |
\check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont |
| 3836 |
\uppercase\expandafter{\romannumeral\@day}% |
| 3837 |
~\monthnamelatin[\@month]\space |
| 3838 |
{\uppercase\expandafter{\romannumeral\@year}}}}% |
| 3839 |
\global\let\datelatin\datelatin |
| 3840 |
% \end{macrocode} |
| 3841 |
%\iffalse |
| 3842 |
% \begin{macrocode} |
| 3843 |
%</dt-latin.def> |
| 3844 |
% \end{macrocode} |
| 3845 |
%\fi |
| 3846 |
%\iffalse |
| 3847 |
% \begin{macrocode} |
| 3848 |
%<*dt-lsorbian.def> |
| 3849 |
% \end{macrocode} |
| 3850 |
%\fi |
| 3851 |
%\subsubsection{LSorbian} |
| 3852 |
% Identify file |
| 3853 |
% \begin{macrocode} |
| 3854 |
\ProvidesFile{dt-lsorbian.def}[2013/09/10]% |
| 3855 |
% \end{macrocode} |
| 3856 |
% Define new month names. |
| 3857 |
% \begin{macrocode} |
| 3858 |
\providecommand{\monthnamenewlsorbian}[1][\month]{% |
| 3859 |
\@orgargctr=#1\relax |
| 3860 |
\ifcase\@orgargctr |
| 3861 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3862 |
Month numbers should go from 1 to 12}% |
| 3863 |
\or januara% |
| 3864 |
\or februara% |
| 3865 |
\or m\v erca% |
| 3866 |
\or apryla% |
| 3867 |
\or maja% |
| 3868 |
\or junija% |
| 3869 |
\or julija% |
| 3870 |
\or awgusta% |
| 3871 |
\or septembra% |
| 3872 |
\or oktobra% |
| 3873 |
\or nowembra% |
| 3874 |
\or decembra% |
| 3875 |
\else |
| 3876 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3877 |
Month numbers should go from 1 to 12}% |
| 3878 |
\fi}% |
| 3879 |
\global\let\monthnamenewlsorbian\monthnamenewlsorbian |
| 3880 |
% \end{macrocode} |
| 3881 |
% Define old month names. |
| 3882 |
% \begin{macrocode} |
| 3883 |
\providecommand{\monthnameoldlsorbian}[1][\month]{% |
| 3884 |
\@orgargctr=#1\relax |
| 3885 |
\ifcase\@orgargctr |
| 3886 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3887 |
Month numbers should go from 1 to 12}% |
| 3888 |
\or wjelikego ro\v zka% |
| 3889 |
\or ma\l ego ro\v zka% |
| 3890 |
\or nal\v etnika% |
| 3891 |
\or jat\v sownika% |
| 3892 |
\or ro\v zownika% |
| 3893 |
\or sma\v znika% |
| 3894 |
\or pra\v znika% |
| 3895 |
\or \v znje\'nca% |
| 3896 |
\or po\v znje\'nca% |
| 3897 |
\or winowca% |
| 3898 |
\or nazymnika% |
| 3899 |
\or godownika% |
| 3900 |
\else |
| 3901 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3902 |
Month numbers should go from 1 to 12}% |
| 3903 |
\fi}% |
| 3904 |
\global\let\monthnameoldlsorbian\monthnameoldlsorbian |
| 3905 |
% \end{macrocode} |
| 3906 |
% Set the default month names. |
| 3907 |
% \begin{macrocode} |
| 3908 |
\global\let\monthnamelsorbian\monthnamenewlsorbian |
| 3909 |
% \end{macrocode} |
| 3910 |
% (Re)Define declaration to switch to new format. |
| 3911 |
% \begin{macrocode} |
| 3912 |
\DeclareRobustCommand*\newdatelsorbian{% |
| 3913 |
\renewcommand{\formatdate}[3]{% |
| 3914 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3915 |
\number\@day.~\monthnamenewlsorbian[\@month]\space\number\@year}}% |
| 3916 |
\global\let\newdatelsorbian\newdatelsorbian |
| 3917 |
% \end{macrocode} |
| 3918 |
% (Re)Define declaration to switch to old format. |
| 3919 |
% \begin{macrocode} |
| 3920 |
\DeclareRobustCommand*\olddatelsorbian{% |
| 3921 |
\renewcommand{\formatdate}[3]{% |
| 3922 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3923 |
\number\@day.~\monthnameoldlsorbian[\@month]\space\number\@year}}% |
| 3924 |
\global\let\olddatelsorbian\olddatelsorbian |
| 3925 |
% \end{macrocode} |
| 3926 |
% Set the default date format. |
| 3927 |
% \begin{macrocode} |
| 3928 |
\global\let\datelsorbian\newdatelsorbian |
| 3929 |
% \end{macrocode} |
| 3930 |
%\iffalse |
| 3931 |
% \begin{macrocode} |
| 3932 |
%</dt-lsorbian.def> |
| 3933 |
% \end{macrocode} |
| 3934 |
%\fi |
| 3935 |
%\iffalse |
| 3936 |
% \begin{macrocode} |
| 3937 |
%<*dt-magyar.def> |
| 3938 |
% \end{macrocode} |
| 3939 |
%\fi |
| 3940 |
%\subsubsection{Magyar} |
| 3941 |
% Identify file |
| 3942 |
% \begin{macrocode} |
| 3943 |
\ProvidesFile{dt-magyar.def}[2013/09/10]% |
| 3944 |
% \end{macrocode} |
| 3945 |
% Define month names. |
| 3946 |
% \begin{macrocode} |
| 3947 |
\providecommand{\monthnamemagyar}[1][\month]{% |
| 3948 |
\@orgargctr=#1\relax |
| 3949 |
\ifcase\@orgargctr |
| 3950 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3951 |
Month numbers should go from 1 to 12}% |
| 3952 |
\or janu\'ar% |
| 3953 |
\or febru\'ar% |
| 3954 |
\or m\'arcius% |
| 3955 |
\or \'aprilis% |
| 3956 |
\or m\'ajus% |
| 3957 |
\or j\'unius% |
| 3958 |
\or j\'ulius% |
| 3959 |
\or augusztus% |
| 3960 |
\or szeptember% |
| 3961 |
\or okt\'ober% |
| 3962 |
\or november% |
| 3963 |
\or december% |
| 3964 |
\else |
| 3965 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3966 |
Month numbers should go from 1 to 12}% |
| 3967 |
\fi}% |
| 3968 |
\global\let\monthnamemagyar\monthnamemagyar |
| 3969 |
% \end{macrocode} |
| 3970 |
% (Re)Define declaration to switch to this format. |
| 3971 |
% \begin{macrocode} |
| 3972 |
\DeclareRobustCommand*\datemagyar{% |
| 3973 |
\renewcommand{\formatdate}[3]{% |
| 3974 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 3975 |
\number\@year.~\monthnamemagyar[\@month]\space\number\@day.}}% |
| 3976 |
\global\let\datemagyar\datemagyar |
| 3977 |
% \end{macrocode} |
| 3978 |
%\iffalse |
| 3979 |
% \begin{macrocode} |
| 3980 |
%</dt-magyar.def> |
| 3981 |
% \end{macrocode} |
| 3982 |
%\fi |
| 3983 |
%\iffalse |
| 3984 |
% \begin{macrocode} |
| 3985 |
%<*dt-naustrian.def> |
| 3986 |
% \end{macrocode} |
| 3987 |
%\fi |
| 3988 |
%\subsubsection{NAustrian} |
| 3989 |
% Identify file |
| 3990 |
% \begin{macrocode} |
| 3991 |
\ProvidesFile{dt-naustrian.def}[2013/09/10]% |
| 3992 |
% \end{macrocode} |
| 3993 |
% Define month names. |
| 3994 |
% \begin{macrocode} |
| 3995 |
\providecommand{\monthnamenaustrian}[1][\month]{% |
| 3996 |
\@orgargctr=#1\relax |
| 3997 |
\ifcase\@orgargctr |
| 3998 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 3999 |
Month numbers should go from 1 to 12}% |
| 4000 |
\or J\"anner% |
| 4001 |
\or Februar% |
| 4002 |
\or M\"arz% |
| 4003 |
\or April% |
| 4004 |
\or Mai% |
| 4005 |
\or Juni% |
| 4006 |
\or Juli% |
| 4007 |
\or August% |
| 4008 |
\or September% |
| 4009 |
\or Oktober% |
| 4010 |
\or November% |
| 4011 |
\or Dezember% |
| 4012 |
\else |
| 4013 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4014 |
Month numbers should go from 1 to 12}% |
| 4015 |
\fi}% |
| 4016 |
\global\let\monthnamenaustrian\monthnamenaustrian |
| 4017 |
% \end{macrocode} |
| 4018 |
% (Re)Define declaration to switch to this format. |
| 4019 |
% \begin{macrocode} |
| 4020 |
\DeclareRobustCommand*\datenaustrian{% |
| 4021 |
\renewcommand{\formatdate}[3]{% |
| 4022 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4023 |
\number\@day.~\monthnamenaustrian[\@month]\space\number\@year}}% |
| 4024 |
\global\let\datenaustrian\datenaustrian |
| 4025 |
% \end{macrocode} |
| 4026 |
%\iffalse |
| 4027 |
% \begin{macrocode} |
| 4028 |
%</dt-naustrian.def> |
| 4029 |
% \end{macrocode} |
| 4030 |
%\fi |
| 4031 |
%\iffalse |
| 4032 |
% \begin{macrocode} |
| 4033 |
%<*dt-newzealand.def> |
| 4034 |
% \end{macrocode} |
| 4035 |
%\fi |
| 4036 |
%\subsection{Compatibility with Babel (Language definition files)} |
| 4037 |
%\subsubsection{newzealand} |
| 4038 |
% Identify file |
| 4039 |
% \begin{macrocode} |
| 4040 |
\ProvidesFile{dt-newzealand.def}[2013/09/10]% |
| 4041 |
% \end{macrocode} |
| 4042 |
%\begin{macro}{\datenewzealand} |
| 4043 |
% \begin{macrocode} |
| 4044 |
\global\let\datenewzealand\usdate |
| 4045 |
% \end{macrocode} |
| 4046 |
%\end{macro} |
| 4047 |
%\begin{macro}{\monthnamenewzealand} |
| 4048 |
% \begin{macrocode} |
| 4049 |
\global\let\monthnamenewzealand\monthnameenglish |
| 4050 |
% \end{macrocode} |
| 4051 |
%\end{macro} |
| 4052 |
%\begin{macro}{\shortmonthnamenewzealand} |
| 4053 |
% \begin{macrocode} |
| 4054 |
\global\let\shortmonthnamenewzealand\shortmonthnameenglish |
| 4055 |
% \end{macrocode} |
| 4056 |
%\end{macro} |
| 4057 |
%\begin{macro}{\dayofweeknameidnewzealand} |
| 4058 |
% \begin{macrocode} |
| 4059 |
\global\let\dayofweeknameidnewzealand\dayofweeknameidenglish |
| 4060 |
% \end{macrocode} |
| 4061 |
%\end{macro} |
| 4062 |
%\begin{macro}{\shortdayofweeknamenewzealand} |
| 4063 |
% \begin{macrocode} |
| 4064 |
\global\let\shortdayofweeknameidnewzealand\shortdayofweeknameidenglish |
| 4065 |
% \end{macrocode} |
| 4066 |
%\end{macro} |
| 4067 |
%\begin{macro}{\ordinaldatenewzealand} |
| 4068 |
% \begin{macrocode} |
| 4069 |
\providecommand*{\ordinaldatenewzealand}[1]{#1}% |
| 4070 |
\global\let\ordinaldatenewzealand\ordinaldatenewzealand |
| 4071 |
% \end{macrocode} |
| 4072 |
%\end{macro} |
| 4073 |
%\iffalse |
| 4074 |
% \begin{macrocode} |
| 4075 |
%</dt-newzealand.def> |
| 4076 |
% \end{macrocode} |
| 4077 |
%\fi |
| 4078 |
%\iffalse |
| 4079 |
% \begin{macrocode} |
| 4080 |
%<*dt-ngerman.def> |
| 4081 |
% \end{macrocode} |
| 4082 |
%\fi |
| 4083 |
%\subsubsection{NGerman} |
| 4084 |
% Identify file |
| 4085 |
% \begin{macrocode} |
| 4086 |
\ProvidesFile{dt-ngerman.def}[2013/09/10]% |
| 4087 |
% \end{macrocode} |
| 4088 |
% Define month names. |
| 4089 |
% \begin{macrocode} |
| 4090 |
\providecommand{\monthnamengerman}[1][\month]{% |
| 4091 |
\@orgargctr=#1\relax |
| 4092 |
\ifcase\@orgargctr |
| 4093 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4094 |
Month numbers should go from 1 to 12}% |
| 4095 |
\or Januar% |
| 4096 |
\or Februar% |
| 4097 |
\or M\"arz% |
| 4098 |
\or April% |
| 4099 |
\or Mai% |
| 4100 |
\or Juni% |
| 4101 |
\or Juli% |
| 4102 |
\or August% |
| 4103 |
\or September% |
| 4104 |
\or Oktober% |
| 4105 |
\or November% |
| 4106 |
\or Dezember% |
| 4107 |
\else |
| 4108 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4109 |
Month numbers should go from 1 to 12}% |
| 4110 |
\fi}% |
| 4111 |
\global\let\monthnamengerman\monthnamengerman |
| 4112 |
% \end{macrocode} |
| 4113 |
% The following week day names were supplied by Uwe Bieling: |
| 4114 |
% \begin{macrocode} |
| 4115 |
\providecommand{\dayofweeknameidngerman}[1]{% |
| 4116 |
\ifcase#1\relax |
| 4117 |
\or Sonntag% |
| 4118 |
\or Montag% |
| 4119 |
\or Dienstag% |
| 4120 |
\or Mittwoch% |
| 4121 |
\or Donnerstag% |
| 4122 |
\or Freitag% |
| 4123 |
\or Samstag% |
| 4124 |
\fi}% |
| 4125 |
\global\let\dayofweeknameidngerman\dayofweeknameidngerman |
| 4126 |
% \end{macrocode} |
| 4127 |
% \begin{macrocode} |
| 4128 |
\providecommand{\shortdayofweeknameidngerman}[1]{% |
| 4129 |
\ifcase#1\relax |
| 4130 |
\or So% |
| 4131 |
\or Mo% |
| 4132 |
\or Di% |
| 4133 |
\or Mi% |
| 4134 |
\or Do% |
| 4135 |
\or Fr% |
| 4136 |
\or Sa% |
| 4137 |
\fi}% |
| 4138 |
\global\let\shortdayofweeknameidngerman\shortdayofweeknameidngerman |
| 4139 |
% \end{macrocode} |
| 4140 |
% (Re)Define declaration to switch to this format. |
| 4141 |
% \begin{macrocode} |
| 4142 |
\DeclareRobustCommand*\datengerman{% |
| 4143 |
\renewcommand{\formatdate}[3]{% |
| 4144 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4145 |
\number\@day.~\monthnamengerman[\@month]\space\number\@year}}% |
| 4146 |
\global\let\datengerman\datengerman |
| 4147 |
% \end{macrocode} |
| 4148 |
%\iffalse |
| 4149 |
% \begin{macrocode} |
| 4150 |
%</dt-ngerman.def> |
| 4151 |
% \end{macrocode} |
| 4152 |
%\fi |
| 4153 |
%\iffalse |
| 4154 |
% \begin{macrocode} |
| 4155 |
%<*dt-norsk.def> |
| 4156 |
% \end{macrocode} |
| 4157 |
%\fi |
| 4158 |
%\subsubsection{Norsk} |
| 4159 |
% Identify file |
| 4160 |
% \begin{macrocode} |
| 4161 |
\ProvidesFile{dt-norsk.def}[2013/09/10]% |
| 4162 |
% \end{macrocode} |
| 4163 |
% Define month names. |
| 4164 |
% \begin{macrocode} |
| 4165 |
\providecommand{\monthnamenorsk}[1][\month]{% |
| 4166 |
\@orgargctr=#1\relax |
| 4167 |
\ifcase\@orgargctr |
| 4168 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4169 |
Month numbers should go from 1 to 12}% |
| 4170 |
\or januar% |
| 4171 |
\or februar% |
| 4172 |
\or mars% |
| 4173 |
\or april% |
| 4174 |
\or mai% |
| 4175 |
\or juni% |
| 4176 |
\or juli% |
| 4177 |
\or august% |
| 4178 |
\or september% |
| 4179 |
\or oktober% |
| 4180 |
\or november% |
| 4181 |
\or desember% |
| 4182 |
\else |
| 4183 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4184 |
Month numbers should go from 1 to 12}% |
| 4185 |
\fi}% |
| 4186 |
\global\let\monthnamenorsk\monthnamenorsk |
| 4187 |
% \end{macrocode} |
| 4188 |
% (Re)Define declaration to switch to this format. |
| 4189 |
% \begin{macrocode} |
| 4190 |
\DeclareRobustCommand*\datenorsk{% |
| 4191 |
\renewcommand{\formatdate}[3]{% |
| 4192 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4193 |
\number\@day.~\monthnamenorsk[\@month]\space\number\@year}}% |
| 4194 |
\global\let\datenorsk\datenorsk |
| 4195 |
% \end{macrocode} |
| 4196 |
% Day of week provided by Tor Inge Birkenes |
| 4197 |
% \begin{macrocode} |
| 4198 |
\providecommand*{\dayofweeknameidnorsk}[1]{% |
| 4199 |
\ifcase#1\relax |
| 4200 |
\or S\o{}ndag% |
| 4201 |
\or Mandag% |
| 4202 |
\or Tirsdag% |
| 4203 |
\or Onsdag% |
| 4204 |
\or Torsdag% |
| 4205 |
\or Fredag% |
| 4206 |
\or L\o{}rdag% |
| 4207 |
\fi} |
| 4208 |
\providecommand*{\shortdayofweeknameidnorsk}[1]{% |
| 4209 |
\ifcase#1\relax |
| 4210 |
\or S\o{}n% |
| 4211 |
\or Man% |
| 4212 |
\or Tir% |
| 4213 |
\or Ons% |
| 4214 |
\or Tor% |
| 4215 |
\or Fre% |
| 4216 |
\or L\o{}r% |
| 4217 |
\fi} |
| 4218 |
% \end{macrocode} |
| 4219 |
%\iffalse |
| 4220 |
% \begin{macrocode} |
| 4221 |
%</dt-norsk.def> |
| 4222 |
% \end{macrocode} |
| 4223 |
%\fi |
| 4224 |
%\iffalse |
| 4225 |
% \begin{macrocode} |
| 4226 |
%<*dt-polish.def> |
| 4227 |
% \end{macrocode} |
| 4228 |
%\fi |
| 4229 |
%\subsubsection{Polish} |
| 4230 |
% Identify file |
| 4231 |
% \begin{macrocode} |
| 4232 |
\ProvidesFile{dt-polish.def}[2013/09/10]% |
| 4233 |
% \end{macrocode} |
| 4234 |
% Define month names. |
| 4235 |
%\begin{macro}{\monthnamepolish} |
| 4236 |
% \begin{macrocode} |
| 4237 |
\providecommand{\monthnamepolish}[1][\month]{% |
| 4238 |
\@orgargctr=#1\relax |
| 4239 |
\ifcase\@orgargctr |
| 4240 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4241 |
Month numbers should go from 1 to 12}% |
| 4242 |
\or stycznia% |
| 4243 |
\or lutego% |
| 4244 |
\or marca% |
| 4245 |
\or kwietnia% |
| 4246 |
\or maja% |
| 4247 |
\or czerwca% |
| 4248 |
\or lipca% |
| 4249 |
\or sierpnia% |
| 4250 |
\or wrze\'snia% |
| 4251 |
\or pa\'zdziernika% |
| 4252 |
\or listopada% |
| 4253 |
\or grudnia% |
| 4254 |
\else |
| 4255 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4256 |
Month numbers should go from 1 to 12}% |
| 4257 |
\fi} |
| 4258 |
\global\let\monthnamepolish\monthnamepolish |
| 4259 |
% \end{macrocode} |
| 4260 |
%\end{macro} |
| 4261 |
% (Re)Define declaration to switch to this format. |
| 4262 |
% \begin{macrocode} |
| 4263 |
\DeclareRobustCommand*\datepolish{% |
| 4264 |
\renewcommand{\formatdate}[3]{% |
| 4265 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4266 |
\number\@day~\monthnamepolish[\@month]\space\number\@year}}% |
| 4267 |
\global\let\datepolish\datepolish |
| 4268 |
% \end{macrocode} |
| 4269 |
% The week names were provided by Piotr Kempa |
| 4270 |
%\begin{macro}{\dayofweeknameidpolish} |
| 4271 |
% \begin{macrocode} |
| 4272 |
\providecommand{\dayofweeknameidpolish}[1]{% |
| 4273 |
\ifcase#1\relax |
| 4274 |
\or Niedziela% |
| 4275 |
\or Poniedzia\l ek% |
| 4276 |
\or Wtorek% |
| 4277 |
\or \'Sroda% |
| 4278 |
\or Czwartek% |
| 4279 |
\or Pi\k atek% |
| 4280 |
\or Sobota% |
| 4281 |
\fi}% |
| 4282 |
\global\let\dayofweeknameidpolish\dayofweeknameidpolish |
| 4283 |
% \end{macrocode} |
| 4284 |
%\end{macro} |
| 4285 |
%\begin{macro}{\shortdayofweeknameidpolish} |
| 4286 |
% \begin{macrocode} |
| 4287 |
\providecommand{\shortdayofweeknameidpolish}[1]{% |
| 4288 |
\ifcase#1\relax |
| 4289 |
\or Ndz.% |
| 4290 |
\or Pon.% |
| 4291 |
\or Wt.% |
| 4292 |
\or \'Sr.% |
| 4293 |
\or Czw.% |
| 4294 |
\or Pt.% |
| 4295 |
\or Sob.% |
| 4296 |
\fi}% |
| 4297 |
\global\let\shortdayofweeknameidpolish\shortdayofweeknameidpolish |
| 4298 |
% \end{macrocode} |
| 4299 |
%\end{macro} |
| 4300 |
%\iffalse |
| 4301 |
% \begin{macrocode} |
| 4302 |
%</dt-polish.def> |
| 4303 |
% \end{macrocode} |
| 4304 |
%\fi |
| 4305 |
%\iffalse |
| 4306 |
% \begin{macrocode} |
| 4307 |
%<*dt-portuges.def> |
| 4308 |
% \end{macrocode} |
| 4309 |
%\fi |
| 4310 |
%\subsubsection{Portuges} |
| 4311 |
% Identify file |
| 4312 |
% \begin{macrocode} |
| 4313 |
\ProvidesFile{dt-portuges.def}[2013/09/10]% |
| 4314 |
% \end{macrocode} |
| 4315 |
% Define week day names. |
| 4316 |
% \begin{macrocode} |
| 4317 |
\providecommand{\dayofweeknameidportuges}[1]{% |
| 4318 |
\ifcase#1\relax |
| 4319 |
\or domingo% |
| 4320 |
\or segunda-feira% |
| 4321 |
\or ter\c{c}a-feira% |
| 4322 |
\or quarta-feira% |
| 4323 |
\or quinta-feira% |
| 4324 |
\or sexta-feira% |
| 4325 |
\or sabado% |
| 4326 |
\fi}% |
| 4327 |
\global\let\dayofweeknameidportuges\dayofweeknameidportuges |
| 4328 |
% \end{macrocode} |
| 4329 |
% Define month names. |
| 4330 |
% \begin{macrocode} |
| 4331 |
\providecommand{\monthnameportuges}[1][\month]{% |
| 4332 |
\@orgargctr=#1\relax |
| 4333 |
\ifcase\@orgargctr |
| 4334 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4335 |
Month numbers should go from 1 to 12}% |
| 4336 |
\or Janeiro% |
| 4337 |
\or Fevereiro% |
| 4338 |
\or Mar\c{c}o% |
| 4339 |
\or Abril% |
| 4340 |
\or Maio% |
| 4341 |
\or Junho% |
| 4342 |
\or Julho% |
| 4343 |
\or Agosto% |
| 4344 |
\or Setembro% |
| 4345 |
\or Outubro% |
| 4346 |
\or Novembro% |
| 4347 |
\or Dezembro% |
| 4348 |
\else |
| 4349 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4350 |
Month numbers should go from 1 to 12}% |
| 4351 |
\fi}% |
| 4352 |
\global\let\monthnameportuges\monthnameportuges |
| 4353 |
% \end{macrocode} |
| 4354 |
% (Re)Define declaration to switch to this format. |
| 4355 |
% \begin{macrocode} |
| 4356 |
\DeclareRobustCommand*\dateportuges{% |
| 4357 |
\renewcommand{\formatdate}[3]{% |
| 4358 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4359 |
\number\@day\space de\space\monthnameportuges[\@month]\space |
| 4360 |
de\space\number\@year}}% |
| 4361 |
\global\let\dateportuges\dateportuges |
| 4362 |
% \end{macrocode} |
| 4363 |
%\iffalse |
| 4364 |
% \begin{macrocode} |
| 4365 |
%</dt-portuges.def> |
| 4366 |
% \end{macrocode} |
| 4367 |
%\fi |
| 4368 |
%\iffalse |
| 4369 |
% \begin{macrocode} |
| 4370 |
%<*dt-romanian.def> |
| 4371 |
% \end{macrocode} |
| 4372 |
%\fi |
| 4373 |
%\subsubsection{Romanian} |
| 4374 |
% Identify file |
| 4375 |
% \begin{macrocode} |
| 4376 |
\ProvidesFile{dt-romanian.def}[2013/09/10]% |
| 4377 |
% \end{macrocode} |
| 4378 |
% Define month names. |
| 4379 |
% \begin{macrocode} |
| 4380 |
\providecommand{\monthnameromanian}[1][\month]{% |
| 4381 |
\@orgargctr=#1\relax |
| 4382 |
\ifcase\@orgargctr |
| 4383 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4384 |
Month numbers should go from 1 to 12}% |
| 4385 |
\or ianuarie% |
| 4386 |
\or februarie% |
| 4387 |
\or martie% |
| 4388 |
\or aprilie% |
| 4389 |
\or mai% |
| 4390 |
\or iunie% |
| 4391 |
\or iulie% |
| 4392 |
\or august% |
| 4393 |
\or septembrie% |
| 4394 |
\or octombrie% |
| 4395 |
\or noiembrie% |
| 4396 |
\or decembrie% |
| 4397 |
\else |
| 4398 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4399 |
Month numbers should go from 1 to 12}% |
| 4400 |
\fi}% |
| 4401 |
\global\let\monthnameromanian\monthnameromanian |
| 4402 |
% \end{macrocode} |
| 4403 |
% (Re)Define declaration to switch to this format. |
| 4404 |
% \begin{macrocode} |
| 4405 |
\DeclareRobustCommand*\dateromanian{% |
| 4406 |
\renewcommand{\formatdate}[3]{% |
| 4407 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4408 |
\number\@day~\monthnameromanian[\@month]\space\number\@year}}% |
| 4409 |
\global\let\dateromanian\dateromanian |
| 4410 |
% \end{macrocode} |
| 4411 |
% The following were provided by Daniel Dumitriu: |
| 4412 |
% \begin{macrocode} |
| 4413 |
\providecommand{\dayofweeknameidromanian}[1]{% |
| 4414 |
\ifcase#1\relax |
| 4415 |
\or duminic\u{a}% |
| 4416 |
\or luni% |
| 4417 |
\or mar\c{t}i% |
| 4418 |
\or miercuri% |
| 4419 |
\or joi% |
| 4420 |
\or vineri% |
| 4421 |
\or s\^{a}mb\u{a}t\u{a}% |
| 4422 |
\fi}% |
| 4423 |
\global\let\dayofweeknameidromanian\dayofweeknameidromanian |
| 4424 |
% \end{macrocode} |
| 4425 |
% |
| 4426 |
% \begin{macrocode} |
| 4427 |
\providecommand{\shortdayofweeknameidromanian}[1]{% |
| 4428 |
\ifcase#1\relax |
| 4429 |
\or D% |
| 4430 |
\or L% |
| 4431 |
\or Ma% |
| 4432 |
\or Mi% |
| 4433 |
\or J% |
| 4434 |
\or V% |
| 4435 |
\or S% |
| 4436 |
\fi}% |
| 4437 |
\global\let\shortdayofweeknameidromanian\shortdayofweeknameidromanian |
| 4438 |
% \end{macrocode} |
| 4439 |
%\iffalse |
| 4440 |
% \begin{macrocode} |
| 4441 |
%</dt-romanian.def> |
| 4442 |
% \end{macrocode} |
| 4443 |
%\fi |
| 4444 |
%\iffalse |
| 4445 |
% \begin{macrocode} |
| 4446 |
%<*dt-russian.def> |
| 4447 |
% \end{macrocode} |
| 4448 |
%\fi |
| 4449 |
%\subsubsection{Russian} |
| 4450 |
% Identify file |
| 4451 |
% \begin{macrocode} |
| 4452 |
\ProvidesFile{dt-russian.def}[2013/09/10]% |
| 4453 |
% \end{macrocode} |
| 4454 |
% Define month names. |
| 4455 |
% \begin{macrocode} |
| 4456 |
\providecommand{\monthnamerussian}[1][\month]{% |
| 4457 |
\@orgargctr=#1\relax |
| 4458 |
\ifcase\@orgargctr |
| 4459 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4460 |
Month numbers should go from 1 to 12}% |
| 4461 |
\or \cyrya\cyrn\cyrv\cyra\cyrr\cyrya\or |
| 4462 |
\cyrf\cyre\cyrv\cyrr\cyra\cyrl\cyrya\or |
| 4463 |
\cyrm\cyra\cyrr\cyrt\cyra\or |
| 4464 |
\cyra\cyrp\cyrr\cyre\cyrl\cyrya\or |
| 4465 |
\cyrm\cyra\cyrya\or |
| 4466 |
\cyri\cyryu\cyrn\cyrya\or |
| 4467 |
\cyri\cyryu\cyrl\cyrya\or |
| 4468 |
\cyra\cyrv\cyrg\cyru\cyrs\cyrt\cyra\or |
| 4469 |
\cyrs\cyre\cyrn\cyrt\cyrya\cyrb\cyrr\cyrya\or |
| 4470 |
\cyro\cyrk\cyrt\cyrya\cyrb\cyrr\cyrya\or |
| 4471 |
\cyrn\cyro\cyrya\cyrb\cyrr\cyrya\or |
| 4472 |
\cyrd\cyre\cyrk\cyra\cyrb\cyrr\cyrya% |
| 4473 |
\else |
| 4474 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4475 |
Month numbers should go from 1 to 12}% |
| 4476 |
\fi}% |
| 4477 |
\global\let\monthnamerussian\monthnamerussian |
| 4478 |
% \end{macrocode} |
| 4479 |
% (Re)Define declaration to switch to this format. |
| 4480 |
% \begin{macrocode} |
| 4481 |
\DeclareRobustCommand*\daterussian{% |
| 4482 |
\renewcommand{\formatdate}[3]{% |
| 4483 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4484 |
\number\@day~\monthnamerussian[\@month]\ \number\@year~\cyrg.}}% |
| 4485 |
\global\let\daterussian\daterussian |
| 4486 |
% \end{macrocode} |
| 4487 |
%\iffalse |
| 4488 |
% \begin{macrocode} |
| 4489 |
%</dt-russian.def> |
| 4490 |
% \end{macrocode} |
| 4491 |
%\fi |
| 4492 |
%\iffalse |
| 4493 |
% \begin{macrocode} |
| 4494 |
%<*dt-samin.def> |
| 4495 |
% \end{macrocode} |
| 4496 |
%\fi |
| 4497 |
%\subsubsection{Samin} |
| 4498 |
% Identify file |
| 4499 |
% \begin{macrocode} |
| 4500 |
\ProvidesFile{dt-samin.def}[2013/09/10]% |
| 4501 |
% \end{macrocode} |
| 4502 |
% Define month names. |
| 4503 |
% \begin{macrocode} |
| 4504 |
\providecommand{\monthnamesamin}[1][\month]{% |
| 4505 |
\@orgargctr=#1\relax |
| 4506 |
\ifcase\@orgargctr |
| 4507 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4508 |
Month numbers should go from 1 to 12}% |
| 4509 |
\or o\dj{}\dj{}ajagem\'anu\or |
| 4510 |
guovvam\'anu\or |
| 4511 |
njuk\v cam\'anu\or |
| 4512 |
cuo\ng{}om\'anu\or |
| 4513 |
miessem\'anu\or |
| 4514 |
geassem\'anu\or |
| 4515 |
suoidnem\'anu\or |
| 4516 |
borgem\'anu\or |
| 4517 |
\v cak\v cam\'anu\or |
| 4518 |
golggotm\'anu\or |
| 4519 |
sk\'abmam\'anu\or |
| 4520 |
juovlam\'anu% |
| 4521 |
\else |
| 4522 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4523 |
Month numbers should go from 1 to 12}% |
| 4524 |
\fi}% |
| 4525 |
\global\let\monthnamesamin\monthnamesamin |
| 4526 |
% \end{macrocode} |
| 4527 |
% (Re)Define declaration to switch to this format. |
| 4528 |
% \begin{macrocode} |
| 4529 |
\DeclareRobustCommand*\datesamin{% |
| 4530 |
\renewcommand{\formatdate}[3]{% |
| 4531 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4532 |
\monthnamesamin[\@month]\space\number\@day.~b.\space |
| 4533 |
\number\@year}}% |
| 4534 |
\global\let\datesamin\datesamin |
| 4535 |
% \end{macrocode} |
| 4536 |
%\iffalse |
| 4537 |
% \begin{macrocode} |
| 4538 |
%</dt-samin.def> |
| 4539 |
% \end{macrocode} |
| 4540 |
%\fi |
| 4541 |
%\iffalse |
| 4542 |
% \begin{macrocode} |
| 4543 |
%<*dt-scottish.def> |
| 4544 |
% \end{macrocode} |
| 4545 |
%\fi |
| 4546 |
%\subsubsection{Scottish} |
| 4547 |
% Identify file |
| 4548 |
% \begin{macrocode} |
| 4549 |
\ProvidesFile{dt-scottish.def}[2013/09/10]% |
| 4550 |
% \end{macrocode} |
| 4551 |
% Define month names. |
| 4552 |
% \begin{macrocode} |
| 4553 |
\providecommand{\monthnamescottish}[1][\month]{% |
| 4554 |
\@orgargctr=#1\relax |
| 4555 |
\ifcase\@orgargctr |
| 4556 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4557 |
Month numbers should go from 1 to 12}% |
| 4558 |
\or am Faoilteach% |
| 4559 |
\or an Gearran% |
| 4560 |
\or am M\`art% |
| 4561 |
\or an Giblean% |
| 4562 |
\or an C\`eitean% |
| 4563 |
\or an t-\`Og mhios% |
| 4564 |
\or an t-Iuchar% |
| 4565 |
\or L\`unasdal% |
| 4566 |
\or an Sultuine% |
| 4567 |
\or an D\`amhar% |
| 4568 |
\or an t-Samhainn% |
| 4569 |
\or an Dubhlachd% |
| 4570 |
\else |
| 4571 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4572 |
Month numbers should go from 1 to 12}% |
| 4573 |
\fi}% |
| 4574 |
\global\let\monthnamescottish\monthnamescottish |
| 4575 |
% \end{macrocode} |
| 4576 |
% (Re)Define declaration to switch to this format. |
| 4577 |
% \begin{macrocode} |
| 4578 |
\DeclareRobustCommand*\datescottish{% |
| 4579 |
\renewcommand{\formatdate}[3]{% |
| 4580 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4581 |
\number\@day\space\monthnamescottish[\@month]\space \number\@year}}% |
| 4582 |
\global\let\datescottish\datescottish |
| 4583 |
% \end{macrocode} |
| 4584 |
%\iffalse |
| 4585 |
% \begin{macrocode} |
| 4586 |
%</dt-scottish.def> |
| 4587 |
% \end{macrocode} |
| 4588 |
%\fi |
| 4589 |
%\iffalse |
| 4590 |
% \begin{macrocode} |
| 4591 |
%<*dt-serbian.def> |
| 4592 |
% \end{macrocode} |
| 4593 |
%\fi |
| 4594 |
%\subsubsection{Serbian} |
| 4595 |
% Identify file |
| 4596 |
% \begin{macrocode} |
| 4597 |
\ProvidesFile{dt-serbian.def}[2013/09/10]% |
| 4598 |
% \end{macrocode} |
| 4599 |
% Define month names. |
| 4600 |
% \begin{macrocode} |
| 4601 |
\providecommand{\monthnameserbian}[1][\month]{% |
| 4602 |
\@orgargctr=#1\relax |
| 4603 |
\ifcase\@orgargctr |
| 4604 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4605 |
Month numbers should go from 1 to 12}% |
| 4606 |
\or januar% |
| 4607 |
\or februar% |
| 4608 |
\or mart% |
| 4609 |
\or april% |
| 4610 |
\or maj% |
| 4611 |
\or juni% |
| 4612 |
\or juli% |
| 4613 |
\or avgust% |
| 4614 |
\or septembar% |
| 4615 |
\or oktobar% |
| 4616 |
\or novembar% |
| 4617 |
\or decembar% |
| 4618 |
\else |
| 4619 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4620 |
Month numbers should go from 1 to 12}% |
| 4621 |
\fi}% |
| 4622 |
\global\let\monthnameserbian\monthnameserbian |
| 4623 |
% \end{macrocode} |
| 4624 |
% (Re)Define declaration to switch to this format. |
| 4625 |
% \begin{macrocode} |
| 4626 |
\DeclareRobustCommand*\dateserbian{% |
| 4627 |
\renewcommand{\formatdate}[3]{% |
| 4628 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4629 |
\number\@day.~\monthnameserbian[\@month]\space \number\@year}}% |
| 4630 |
\global\let\dateserbian\dateserbian |
| 4631 |
% \end{macrocode} |
| 4632 |
%\iffalse |
| 4633 |
% \begin{macrocode} |
| 4634 |
%</dt-serbian.def> |
| 4635 |
% \end{macrocode} |
| 4636 |
%\fi |
| 4637 |
%\iffalse |
| 4638 |
% \begin{macrocode} |
| 4639 |
%<*dt-slovak.def> |
| 4640 |
% \end{macrocode} |
| 4641 |
%\fi |
| 4642 |
%\subsubsection{Slovak} |
| 4643 |
% Identify file |
| 4644 |
% \begin{macrocode} |
| 4645 |
\ProvidesFile{dt-slovak.def}[2013/09/10]% |
| 4646 |
% \end{macrocode} |
| 4647 |
% Define month names. |
| 4648 |
% \begin{macrocode} |
| 4649 |
\providecommand{\monthnameslovak}[1][\month]{% |
| 4650 |
\@orgargctr=#1\relax |
| 4651 |
\ifcase\@orgargctr |
| 4652 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month |
| 4653 |
numbers should go from 1 to 12}% |
| 4654 |
\or janu\'ara% |
| 4655 |
\or febru\'ara% |
| 4656 |
\or marca% |
| 4657 |
\or apr\'{\i}la% |
| 4658 |
\or m\'aja% |
| 4659 |
\or j\'una% |
| 4660 |
\or j\'ula% |
| 4661 |
\or augusta% |
| 4662 |
\or septembra% |
| 4663 |
\or okt\'obra% |
| 4664 |
\or novembra% |
| 4665 |
\or decembra% |
| 4666 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4667 |
Month numbers should go from 1 to 12}% |
| 4668 |
\fi}% |
| 4669 |
\global\let\monthnameslovak\monthnameslovak |
| 4670 |
% \end{macrocode} |
| 4671 |
% (Re)Define declaration to switch to this format. |
| 4672 |
% \begin{macrocode} |
| 4673 |
\DeclareRobustCommand*\dateslovak{% |
| 4674 |
\renewcommand{\formatdate}[3]{% |
| 4675 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4676 |
\number\@day.~\monthnameslovak[\@month]\space \number\@year}}% |
| 4677 |
\global\let\dateslovak\dateslovak |
| 4678 |
% \end{macrocode} |
| 4679 |
%\iffalse |
| 4680 |
% \begin{macrocode} |
| 4681 |
%</dt-slovak.def> |
| 4682 |
% \end{macrocode} |
| 4683 |
%\fi |
| 4684 |
%\iffalse |
| 4685 |
% \begin{macrocode} |
| 4686 |
%<*dt-slovene.def> |
| 4687 |
% \end{macrocode} |
| 4688 |
%\fi |
| 4689 |
%\subsubsection{Slovene} |
| 4690 |
% Identify file |
| 4691 |
% \begin{macrocode} |
| 4692 |
\ProvidesFile{dt-slovene.def}[2013/09/10]% |
| 4693 |
% \end{macrocode} |
| 4694 |
% Define month names. |
| 4695 |
% \begin{macrocode} |
| 4696 |
\providecommand{\monthnameslovene}[1][\month]{% |
| 4697 |
\@orgargctr=#1\relax |
| 4698 |
\ifcase\@orgargctr |
| 4699 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4700 |
Month numbers should go from 1 to 12}% |
| 4701 |
\or januar% |
| 4702 |
\or februar% |
| 4703 |
\or marec% |
| 4704 |
\or april% |
| 4705 |
\or maj% |
| 4706 |
\or junij% |
| 4707 |
\or julij% |
| 4708 |
\or avgust% |
| 4709 |
\or september% |
| 4710 |
\or oktober% |
| 4711 |
\or november% |
| 4712 |
\or december% |
| 4713 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4714 |
Month numbers should go from 1 to 12}% |
| 4715 |
\fi}% |
| 4716 |
\global\let\monthnameslovene\monthnameslovene |
| 4717 |
% \end{macrocode} |
| 4718 |
% (Re)Define declaration to switch to this format. |
| 4719 |
% \begin{macrocode} |
| 4720 |
\DeclareRobustCommand*\dateslovene{% |
| 4721 |
\renewcommand{\formatdate}[3]{% |
| 4722 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4723 |
\number\@day.~\monthnameslovene[\@month]\space \number\@year}}% |
| 4724 |
\global\let\dateslovene\dateslovene |
| 4725 |
% \end{macrocode} |
| 4726 |
%\iffalse |
| 4727 |
% \begin{macrocode} |
| 4728 |
%</dt-slovene.def> |
| 4729 |
% \end{macrocode} |
| 4730 |
%\fi |
| 4731 |
%\iffalse |
| 4732 |
% \begin{macrocode} |
| 4733 |
%<*dt-spanish.def> |
| 4734 |
% \end{macrocode} |
| 4735 |
%\fi |
| 4736 |
%\subsubsection{Spanish} |
| 4737 |
% Identify file |
| 4738 |
% \begin{macrocode} |
| 4739 |
\ProvidesFile{dt-spanish.def}[2013/09/10]% |
| 4740 |
% \end{macrocode} |
| 4741 |
% Define week day names. |
| 4742 |
% \begin{macrocode} |
| 4743 |
\providecommand{\dayofweeknameidspanish}[1]{% |
| 4744 |
\ifcase#1\relax |
| 4745 |
\or domingo% |
| 4746 |
\or lunes% |
| 4747 |
\or martes% |
| 4748 |
\or mi\'ercoles% |
| 4749 |
\or jueves% |
| 4750 |
\or viernes% |
| 4751 |
\or s\'abado% |
| 4752 |
\fi}% |
| 4753 |
\global\let\dayofweeknameidspanish\dayofweeknameidspanish |
| 4754 |
% \end{macrocode} |
| 4755 |
% Define abbreviated week day names (is this correct?) |
| 4756 |
% \begin{macrocode} |
| 4757 |
\providecommand{\shortdayofweeknameidspanish}[1]{% |
| 4758 |
\ifcase#1\relax |
| 4759 |
\or dom% |
| 4760 |
\or lun% |
| 4761 |
\or mar% |
| 4762 |
\or mi\'e% |
| 4763 |
\or jue% |
| 4764 |
\or vie% |
| 4765 |
\or s\'ab% |
| 4766 |
\fi}% |
| 4767 |
\global\let\shortdayofweeknameidspanish\shortdayofweeknameidspanish |
| 4768 |
% \end{macrocode} |
| 4769 |
% Define month names. |
| 4770 |
% \begin{macrocode} |
| 4771 |
\providecommand{\monthnamespanish}[1][\month]{% |
| 4772 |
\@orgargctr=#1\relax |
| 4773 |
\ifcase\@orgargctr |
| 4774 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4775 |
Month numbers should go from 1 to 12}% |
| 4776 |
\or enero% |
| 4777 |
\or febrero% |
| 4778 |
\or marzo% |
| 4779 |
\or abril% |
| 4780 |
\or mayo% |
| 4781 |
\or junio% |
| 4782 |
\or julio% |
| 4783 |
\or agosto% |
| 4784 |
\or septiembre% |
| 4785 |
\or octubre% |
| 4786 |
\or noviembre% |
| 4787 |
\or diciembre% |
| 4788 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4789 |
Month numbers should go from 1 to 12}% |
| 4790 |
\fi}% |
| 4791 |
\global\let\monthnamespanish\monthnamespanish |
| 4792 |
% \end{macrocode} |
| 4793 |
% (Re)Define declaration to switch to this format. |
| 4794 |
% \begin{macrocode} |
| 4795 |
\DeclareRobustCommand*\datespanish{% |
| 4796 |
\renewcommand{\formatdate}[3]{% |
| 4797 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4798 |
\number\@day~de \monthnamespanish[\@month]\ de~\number\@year}}% |
| 4799 |
\global\let\datespanish\datespanish |
| 4800 |
% \end{macrocode} |
| 4801 |
%\iffalse |
| 4802 |
% \begin{macrocode} |
| 4803 |
%</dt-spanish.def> |
| 4804 |
% \end{macrocode} |
| 4805 |
%\fi |
| 4806 |
%\iffalse |
| 4807 |
% \begin{macrocode} |
| 4808 |
%<*dt-swedish.def> |
| 4809 |
% \end{macrocode} |
| 4810 |
%\fi |
| 4811 |
%\subsubsection{Swedish} |
| 4812 |
% Identify file |
| 4813 |
% \begin{macrocode} |
| 4814 |
\ProvidesFile{dt-swedish.def}[2013/09/10]% |
| 4815 |
% \end{macrocode} |
| 4816 |
% Define month names. |
| 4817 |
% \begin{macrocode} |
| 4818 |
\providecommand{\monthnameswedish}[1][\month]{% |
| 4819 |
\@orgargctr=#1\relax |
| 4820 |
\ifcase\@orgargctr |
| 4821 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4822 |
Month numbers should go from 1 to 12}% |
| 4823 |
\or januari% |
| 4824 |
\or februari% |
| 4825 |
\or mars% |
| 4826 |
\or april% |
| 4827 |
\or maj% |
| 4828 |
\or juni% |
| 4829 |
\or juli% |
| 4830 |
\or augusti% |
| 4831 |
\or september% |
| 4832 |
\or oktober% |
| 4833 |
\or november% |
| 4834 |
\or december% |
| 4835 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4836 |
Month numbers should go from 1 to 12}% |
| 4837 |
\fi}% |
| 4838 |
\global\let\monthnameswedish\monthnameswedish |
| 4839 |
% \end{macrocode} |
| 4840 |
% (Re)Define declaration to switch to this format |
| 4841 |
% (day monthname year). |
| 4842 |
% \begin{macrocode} |
| 4843 |
\DeclareRobustCommand*\dateswedish{% |
| 4844 |
\renewcommand{\formatdate}[3]{% |
| 4845 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4846 |
\number\@day~\monthnameswedish[\@month]\space\number\@year}}% |
| 4847 |
\global\let\dateswedish\dateswedish |
| 4848 |
% \end{macrocode} |
| 4849 |
% (Re)Define declaration to switch to this format |
| 4850 |
% (two-digit numerical). |
| 4851 |
% \begin{macrocode} |
| 4852 |
\DeclareRobustCommand*\datesymd{% |
| 4853 |
\renewcommand{\formatdate}[3]{% |
| 4854 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4855 |
\number\@year-\two@digits\@month-\two@digits\@day}% |
| 4856 |
}% |
| 4857 |
\global\let\datesymd\datesymd |
| 4858 |
% \end{macrocode} |
| 4859 |
% (Re)Define declaration to switch to this format |
| 4860 |
% (numerical). |
| 4861 |
% \begin{macrocode} |
| 4862 |
\DeclareRobustCommand*\datesdmy{% |
| 4863 |
\renewcommand{\formatdate}[3]{% |
| 4864 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4865 |
\number\@day/\number\@month\space\number\@year}% |
| 4866 |
}% |
| 4867 |
\global\let\datesdmy\datesdmy |
| 4868 |
% \end{macrocode} |
| 4869 |
% Day of weekname provided by Johan Sj\"oblom |
| 4870 |
% \begin{macrocode} |
| 4871 |
\providecommand*{\dayofweeknameidswedish}[1]{% |
| 4872 |
\ifcase#1\relax |
| 4873 |
\or S\"ondag% |
| 4874 |
\or M\aa{}ndag% |
| 4875 |
\or Tisdag% |
| 4876 |
\or Onsdag% |
| 4877 |
\or Torsdag% |
| 4878 |
\or Fredag% |
| 4879 |
\or L\"ordag% |
| 4880 |
\fi} |
| 4881 |
\providecommand*{\shortdayofweeknameidswedish}[1]{% |
| 4882 |
\ifcase#1\relax |
| 4883 |
\or S\"on% |
| 4884 |
\or M\aa{}n% |
| 4885 |
\or Tis% |
| 4886 |
\or Ons% |
| 4887 |
\or Tor% |
| 4888 |
\or Fre% |
| 4889 |
\or L\"or% |
| 4890 |
\fi} |
| 4891 |
% \end{macrocode} |
| 4892 |
%\iffalse |
| 4893 |
% \begin{macrocode} |
| 4894 |
%</dt-swedish.def> |
| 4895 |
% \end{macrocode} |
| 4896 |
%\fi |
| 4897 |
%\iffalse |
| 4898 |
% \begin{macrocode} |
| 4899 |
%<*dt-turkish.def> |
| 4900 |
% \end{macrocode} |
| 4901 |
%\fi |
| 4902 |
%\subsubsection{Turkish} |
| 4903 |
% Identify file |
| 4904 |
% \begin{macrocode} |
| 4905 |
\ProvidesFile{dt-turkish.def}[2013/09/10]% |
| 4906 |
% \end{macrocode} |
| 4907 |
% Define month names. |
| 4908 |
% \begin{macrocode} |
| 4909 |
\providecommand{\monthnameturkish}[1][\month]{% |
| 4910 |
\@orgargctr=#1\relax |
| 4911 |
\ifcase\@orgargctr |
| 4912 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4913 |
Month numbers should go from 1 to 12}% |
| 4914 |
\or Ocak% |
| 4915 |
\or \c Subat% |
| 4916 |
\or Mart% |
| 4917 |
\or Nisan% |
| 4918 |
\or May\i{}s% |
| 4919 |
\or Haziran% |
| 4920 |
\or Temmuz% |
| 4921 |
\or A\u gustos% |
| 4922 |
\or Eyl\"ul% |
| 4923 |
\or Ekim% |
| 4924 |
\or Kas\i{}m% |
| 4925 |
\or Aral\i{}k% |
| 4926 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 4927 |
Month numbers should go from 1 to 12}% |
| 4928 |
\fi}% |
| 4929 |
\global\let\monthnameturkish\monthnameturkish |
| 4930 |
% \end{macrocode} |
| 4931 |
% (Re)Define declaration to switch to this format. |
| 4932 |
% \begin{macrocode} |
| 4933 |
\DeclareRobustCommand*\dateturkish{% |
| 4934 |
\renewcommand{\formatdate}[3]{% |
| 4935 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 4936 |
\number\@day~\monthnameturkish[\@month]\space\number\@year}}% |
| 4937 |
\global\let\dateturkish\dateturkish |
| 4938 |
% \end{macrocode} |
| 4939 |
%\iffalse |
| 4940 |
% \begin{macrocode} |
| 4941 |
%</dt-turkish.def> |
| 4942 |
% \end{macrocode} |
| 4943 |
%\fi |
| 4944 |
%\iffalse |
| 4945 |
% \begin{macrocode} |
| 4946 |
%<*dt-UKenglish.def> |
| 4947 |
% \end{macrocode} |
| 4948 |
%\fi |
| 4949 |
%\subsubsection{UKenglish} |
| 4950 |
% Identify file |
| 4951 |
% \begin{macrocode} |
| 4952 |
\ProvidesFile{dt-UKenglish.def}[2013/09/10]% |
| 4953 |
% \end{macrocode} |
| 4954 |
%\begin{macro}{\dateUKenglish} |
| 4955 |
% \begin{macrocode} |
| 4956 |
\global\let\dateUKenglish\longdate |
| 4957 |
% \end{macrocode} |
| 4958 |
%\end{macro} |
| 4959 |
%\begin{macro}{\monthnameUKenglish} |
| 4960 |
% \begin{macrocode} |
| 4961 |
\global\let\monthnameUKenglish\monthnameenglish |
| 4962 |
% \end{macrocode} |
| 4963 |
%\end{macro} |
| 4964 |
%\begin{macro}{\shortmonthnameUKenglish} |
| 4965 |
% \begin{macrocode} |
| 4966 |
\global\let\shortmonthnameUKenglish\shortmonthnameenglish |
| 4967 |
% \end{macrocode} |
| 4968 |
%\end{macro} |
| 4969 |
%\begin{macro}{\dayofweeknameidUKenglish} |
| 4970 |
% \begin{macrocode} |
| 4971 |
\global\let\dayofweeknameidUKenglish\dayofweeknameidenglish |
| 4972 |
% \end{macrocode} |
| 4973 |
%\end{macro} |
| 4974 |
%\begin{macro}{\shortdayofweeknameidUKenglish} |
| 4975 |
% \begin{macrocode} |
| 4976 |
\global\let\shortdayofweeknameidUKenglish\shortdayofweeknameidenglish |
| 4977 |
% \end{macrocode} |
| 4978 |
%\end{macro} |
| 4979 |
%\begin{macro}{\ordinaldateUKenglish} |
| 4980 |
% \begin{macrocode} |
| 4981 |
\global\let\ordinaldateUKenglish\ordinaldateenglish |
| 4982 |
% \end{macrocode} |
| 4983 |
%\end{macro} |
| 4984 |
%\iffalse |
| 4985 |
% \begin{macrocode} |
| 4986 |
%</dt-UKenglish.def> |
| 4987 |
% \end{macrocode} |
| 4988 |
%\fi |
| 4989 |
%\iffalse |
| 4990 |
% \begin{macrocode} |
| 4991 |
%<*dt-ukraineb.def> |
| 4992 |
% \end{macrocode} |
| 4993 |
%\fi |
| 4994 |
%\subsubsection{Ukraine} |
| 4995 |
% Identify file |
| 4996 |
% \begin{macrocode} |
| 4997 |
\ProvidesFile{dt-ukraineb.def}[2013/09/10]% |
| 4998 |
% \end{macrocode} |
| 4999 |
% Define month names. |
| 5000 |
% \begin{macrocode} |
| 5001 |
\providecommand{\monthnameukraineb}[1][\month]{% |
| 5002 |
\@orgargctr=#1\relax |
| 5003 |
\ifcase\@orgargctr |
| 5004 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5005 |
Month numbers should go from 1 to 12}% |
| 5006 |
\or \cyrs\cyrii\cyrch\cyrn\cyrya\or |
| 5007 |
\cyrl\cyryu\cyrt\cyro\cyrg\cyro\or |
| 5008 |
\cyrb\cyre\cyrr\cyre\cyrz\cyrn\cyrya\or |
| 5009 |
\cyrk\cyrv\cyrii\cyrt\cyrn\cyrya\or |
| 5010 |
\cyrt\cyrr\cyra\cyrv\cyrn\cyrya\or |
| 5011 |
\cyrch\cyre\cyrr\cyrv\cyrn\cyrya\or |
| 5012 |
\cyrl\cyri\cyrp\cyrn\cyrya\or |
| 5013 |
\cyrs\cyre\cyrr\cyrp\cyrn\cyrya\or |
| 5014 |
\cyrv\cyre\cyrr\cyre\cyrs\cyrn\cyrya\or |
| 5015 |
\cyrzh\cyro\cyrv\cyrt\cyrn\cyrya\or |
| 5016 |
\cyrl\cyri\cyrs\cyrt\cyro\cyrp\cyra\cyrd\cyra\or |
| 5017 |
\cyrg\cyrr\cyru\cyrd\cyrn\cyrya% |
| 5018 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5019 |
Month numbers should go from 1 to 12}% |
| 5020 |
\fi}% |
| 5021 |
\global\let\monthnameukraineb\monthnameukraineb |
| 5022 |
% \end{macrocode} |
| 5023 |
% (Re)Define declaration to switch to this format. |
| 5024 |
% \begin{macrocode} |
| 5025 |
\DeclareRobustCommand*\dateukraineb{% |
| 5026 |
\renewcommand{\formatdate}[3]{% |
| 5027 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 5028 |
\number\@day~\monthnameukraineb[\@month]\space\number\@year~\cyrr.}}% |
| 5029 |
\global\let\dateukraineb\dateukraineb |
| 5030 |
% \end{macrocode} |
| 5031 |
%\iffalse |
| 5032 |
% \begin{macrocode} |
| 5033 |
%</dt-ukraineb.def> |
| 5034 |
% \end{macrocode} |
| 5035 |
%\fi |
| 5036 |
%\iffalse |
| 5037 |
% \begin{macrocode} |
| 5038 |
%<*dt-USenglish.def> |
| 5039 |
% \end{macrocode} |
| 5040 |
%\fi |
| 5041 |
%\subsubsection{USenglish} |
| 5042 |
% Identify file |
| 5043 |
% \begin{macrocode} |
| 5044 |
\ProvidesFile{dt-USenglish.def}[2013/09/10]% |
| 5045 |
% \end{macrocode} |
| 5046 |
%\begin{macro}{\dateUSenglish} |
| 5047 |
% \begin{macrocode} |
| 5048 |
\global\let\dateUSenglish\usdate |
| 5049 |
% \end{macrocode} |
| 5050 |
%\end{macro} |
| 5051 |
%\begin{macrocode}{\monthnameUSenglish} |
| 5052 |
% \begin{macrocode} |
| 5053 |
\global\let\monthnameUSenglish\monthnameenglish |
| 5054 |
% \end{macrocode} |
| 5055 |
%\end{macro} |
| 5056 |
%\begin{macro}{\shortmonthnameUSenglish} |
| 5057 |
% \begin{macrocode} |
| 5058 |
\global\let\shortmonthnameUSenglish\shortmonthnameenglish |
| 5059 |
% \end{macrocode} |
| 5060 |
%\end{macro} |
| 5061 |
%\begin{macro}{\dayofweeknameidUSenglish} |
| 5062 |
% \begin{macrocode} |
| 5063 |
\global\let\dayofweeknameidUSenglish\dayofweeknameidenglish |
| 5064 |
% \end{macrocode} |
| 5065 |
%\end{macro} |
| 5066 |
%\begin{macrocode}{\shortdayofweeknameidUSenglish} |
| 5067 |
% \begin{macrocode} |
| 5068 |
\global\let\shortdayofweeknameidUSenglish\shortdayofweeknameidenglish |
| 5069 |
% \end{macrocode} |
| 5070 |
%\end{macro} |
| 5071 |
%\begin{macro}{\ordinaldateUSenglish} |
| 5072 |
% \begin{macrocode} |
| 5073 |
\newcommand*{\ordinaldateUSenglish}[1]{#1}% |
| 5074 |
\global\let\ordinaldateUSenglish\ordinaldateUSenglish |
| 5075 |
% \end{macrocode} |
| 5076 |
%\end{macro} |
| 5077 |
%\iffalse |
| 5078 |
% \begin{macrocode} |
| 5079 |
%</dt-USenglish.def> |
| 5080 |
% \end{macrocode} |
| 5081 |
%\fi |
| 5082 |
%\iffalse |
| 5083 |
% \begin{macrocode} |
| 5084 |
%<*dt-usorbian.def> |
| 5085 |
% \end{macrocode} |
| 5086 |
%\fi |
| 5087 |
%\subsubsection{USorbian} |
| 5088 |
% Identify file |
| 5089 |
% \begin{macrocode} |
| 5090 |
\ProvidesFile{dt-usorbian.def}[2013/09/10]% |
| 5091 |
% \end{macrocode} |
| 5092 |
% Define (new) month names. |
| 5093 |
% \begin{macrocode} |
| 5094 |
\providecommand{\monthnamenewusorbian}[1][\month]{% |
| 5095 |
\@orgargctr=#1\relax |
| 5096 |
\ifcase\@orgargctr |
| 5097 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5098 |
Month numbers should go from 1 to 12}% |
| 5099 |
\or januara% |
| 5100 |
\or februara% |
| 5101 |
\or m\v erca% |
| 5102 |
\or apryla% |
| 5103 |
\or meje% |
| 5104 |
\or junija% |
| 5105 |
\or julija% |
| 5106 |
\or awgusta% |
| 5107 |
\or septembra% |
| 5108 |
\or oktobra% |
| 5109 |
\or nowembra% |
| 5110 |
\or decembra% |
| 5111 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5112 |
Month numbers should go from 1 to 12}% |
| 5113 |
\fi}% |
| 5114 |
\global\let\monthnamenewusorbian\monthnamenewusorbian |
| 5115 |
% \end{macrocode} |
| 5116 |
% Define (old) month names. |
| 5117 |
% \begin{macrocode} |
| 5118 |
\providecommand{\monthnameoldusorbian}[1][\month]{% |
| 5119 |
\@orgargctr=#1\relax |
| 5120 |
\ifcase\@orgargctr |
| 5121 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5122 |
Month numbers should go from 1 to 12}% |
| 5123 |
\or wulkeho r\'o\v zka% |
| 5124 |
\or ma\l eho r\'o\v zka% |
| 5125 |
\or nal\v etnika% |
| 5126 |
\or jutrownika% |
| 5127 |
\or r\'o\v zownika% |
| 5128 |
\or sma\v znika% |
| 5129 |
\or pra\v znika% |
| 5130 |
\or \v znjenca% |
| 5131 |
\or po\v znjenca% |
| 5132 |
\or winowca% |
| 5133 |
\or nazymnika% |
| 5134 |
\or hodownika% |
| 5135 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 to 12}% |
| 5136 |
\fi}% |
| 5137 |
\global\let\monthnameoldusorbian\monthnameoldusorbian |
| 5138 |
% \end{macrocode} |
| 5139 |
% Set up default |
| 5140 |
% \begin{macrocode} |
| 5141 |
\global\let\monthnameusorbian\monthnamenewusorbian |
| 5142 |
% \end{macrocode} |
| 5143 |
% (Re)Define declaration to switch to (new) format. |
| 5144 |
% \begin{macrocode} |
| 5145 |
\DeclareRobustCommand*\newdateusorbian{% |
| 5146 |
\renewcommand{\formatdate}[3]{% |
| 5147 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 5148 |
\number\@day.~\monthnamenewusorbian[\@month]\space\number\@year}}% |
| 5149 |
\global\let\newdateusorbian\newdateusorbian |
| 5150 |
% \end{macrocode} |
| 5151 |
% (Re)Define declaration to switch to (old) format. |
| 5152 |
% \begin{macrocode} |
| 5153 |
\DeclareRobustCommand*\olddateusorbian{% |
| 5154 |
\renewcommand{\formatdate}[3]{% |
| 5155 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 5156 |
\number\@day.~\monthnameoldusorbian[\@month]\space\number\@year}}% |
| 5157 |
\global\let\olddateusorbian\olddateusorbian |
| 5158 |
% \end{macrocode} |
| 5159 |
% Set up default |
| 5160 |
% \begin{macrocode} |
| 5161 |
\global\let\dateusorbian\newdateusorbian |
| 5162 |
% \end{macrocode} |
| 5163 |
%\iffalse |
| 5164 |
% \begin{macrocode} |
| 5165 |
%</dt-usorbian.def> |
| 5166 |
% \end{macrocode} |
| 5167 |
%\fi |
| 5168 |
%\iffalse |
| 5169 |
% \begin{macrocode} |
| 5170 |
%<*dt-welsh.def> |
| 5171 |
% \end{macrocode} |
| 5172 |
%\fi |
| 5173 |
%\subsubsection{Welsh} |
| 5174 |
% Identify file |
| 5175 |
% \begin{macrocode} |
| 5176 |
\ProvidesFile{dt-welsh.def}[2013/09/10]% |
| 5177 |
% \end{macrocode} |
| 5178 |
%\begin{macro}{\ordinaldatewelsh} |
| 5179 |
% Welsh version: |
| 5180 |
% \begin{macrocode} |
| 5181 |
\providecommand*{\ordinaldatewelsh}[1]{% |
| 5182 |
#1\ifnum#1=1\/\textsuperscript{a\~n}\fi}% |
| 5183 |
\global\let\ordinaldatewelsh\ordinaldatewelsh |
| 5184 |
% \end{macrocode} |
| 5185 |
%\end{macro} |
| 5186 |
% Define month names. |
| 5187 |
% \begin{macrocode} |
| 5188 |
\providecommand{\monthnamewelsh}[1][\month]{% |
| 5189 |
\@orgargctr=#1\relax |
| 5190 |
\ifcase\@orgargctr |
| 5191 |
\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5192 |
Month numbers should go from 1 to 12}% |
| 5193 |
\or Ionawr% |
| 5194 |
\or Chwefror% |
| 5195 |
\or Mawrth% |
| 5196 |
\or Ebrill% |
| 5197 |
\or Mai% |
| 5198 |
\or Mehefin% |
| 5199 |
\or Gorffennaf% |
| 5200 |
\or Awst% |
| 5201 |
\or Medi% |
| 5202 |
\or Hydref% |
| 5203 |
\or Tachwedd% |
| 5204 |
\or Rhagfyr% |
| 5205 |
\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{% |
| 5206 |
Month numbers should go from 1 to 12}% |
| 5207 |
\fi}% |
| 5208 |
\global\let\monthnamewelsh\monthnamewelsh |
| 5209 |
% \end{macrocode} |
| 5210 |
% (Re)Define declaration to switch to this format. |
| 5211 |
%\changes{5.60}{2014-09-25}{removed `a viz'} |
| 5212 |
% \begin{macrocode} |
| 5213 |
\DeclareRobustCommand*\datewelsh{% |
| 5214 |
\renewcommand{\formatdate}[3]{% |
| 5215 |
\@day=##1\relax\@month=##2\relax\@year=##3\relax |
| 5216 |
\ifnum\@day=1\relax |
| 5217 |
1\/$^{\mathrm{a\tilde{n}}}$% |
| 5218 |
\else |
| 5219 |
\number\@day |
| 5220 |
\fi |
| 5221 |
\space |
| 5222 |
\monthnamewelsh[\@month]\space\number\@year}% |
| 5223 |
}% |
| 5224 |
\global\let\datewelsh\datewelsh |
| 5225 |
% \end{macrocode} |
| 5226 |
% \subsection{LaTeX2HTML Perl Script} |
| 5227 |
%\iffalse |
| 5228 |
% \begin{macrocode} |
| 5229 |
%</dt-welsh.def> |
| 5230 |
% \end{macrocode} |
| 5231 |
%\fi |
| 5232 |
%\iffalse |
| 5233 |
% \begin{macrocode} |
| 5234 |
%<*dt-lang.tex> |
| 5235 |
% \end{macrocode} |
| 5236 |
%\fi |
| 5237 |
%\iffalse |
| 5238 |
\documentclass{article} |
| 5239 |
|
| 5240 |
\usepackage[T1]{fontenc} |
| 5241 |
\usepackage[french,spanish,english]{babel} |
| 5242 |
\usepackage{datetime} % Date will be language-dependent |
| 5243 |
%\usepackage[iso]{datetime} % Date will be displayed the same for all languages |
| 5244 |
|
| 5245 |
\begin{document} |
| 5246 |
English: \today |
| 5247 |
|
| 5248 |
\selectlanguage{french} |
| 5249 |
French: \today |
| 5250 |
|
| 5251 |
\selectlanguage{spanish} |
| 5252 |
Spanish: \today |
| 5253 |
|
| 5254 |
\begin{otherlanguage}{french} |
| 5255 |
French: \today |
| 5256 |
\end{otherlanguage} |
| 5257 |
|
| 5258 |
\today |
| 5259 |
\end{document} |
| 5260 |
%\fi |
| 5261 |
%\iffalse |
| 5262 |
% \begin{macrocode} |
| 5263 |
%</dt-lang.tex> |
| 5264 |
% \end{macrocode} |
| 5265 |
%\fi |
| 5266 |
%\iffalse |
| 5267 |
% \begin{macrocode} |
| 5268 |
%<*dt-sampl.tex> |
| 5269 |
% \end{macrocode} |
| 5270 |
%\fi |
| 5271 |
%\iffalse |
| 5272 |
\documentclass[a4paper]{article} |
| 5273 |
|
| 5274 |
\usepackage{ifpdf} |
| 5275 |
\usepackage{datetime} |
| 5276 |
|
| 5277 |
|
| 5278 |
\ifpdf |
| 5279 |
\pdfinfo{ |
| 5280 |
/CreationDate (D:20040501215500Z) |
| 5281 |
/ModDate (D:\pdfcreationdate) |
| 5282 |
} |
| 5283 |
\fi |
| 5284 |
|
| 5285 |
\padzeroes[8] |
| 5286 |
|
| 5287 |
\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR} |
| 5288 |
\newdateformat{usvardate}{\monthname[\THEMONTH]~\ordinaldate{\THEDAY}, \THEYEAR} |
| 5289 |
\newdateformat{mydate}{\ifshowdow \dayofweekname{\THEDAY}{\THEMONTH}{\THEYEAR} \fi |
| 5290 |
\THEDAY\ \monthname[\THEMONTH], \THEYEAR} |
| 5291 |
\newdateformat{yyyymmdd}{\THEYEAR\twodigit{\THEMONTH}\twodigit{\THEDAY}} |
| 5292 |
\newdateformat{ukvardate}{\THEDAY\ \monthname[\THEMONTH]\ \THEYEAR} |
| 5293 |
|
| 5294 |
\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}} |
| 5295 |
\newtimeformat{dashtime12}{\THEHOURXII-\twodigit{\THEMINUTE}} |
| 5296 |
\newtimeformat{hhmm}{\twodigit{\THEHOUR}\twodigit{\THEMINUTE}} |
| 5297 |
|
| 5298 |
\begin{document} |
| 5299 |
|
| 5300 |
\section{Date Formats} |
| 5301 |
Default: \today. |
| 5302 |
|
| 5303 |
\begin{tabular}{ll} |
| 5304 |
\bfseries Declaration & \bfseries\verb|\today|\\ |
| 5305 |
\verb|\longdate| & \longdate\today\\ |
| 5306 |
\verb|\shortdate| & \shortdate\today\\ |
| 5307 |
\verb|\yyyymmdddate| & \yyyymmdddate\today\\ |
| 5308 |
\verb|\ddmmyyyydate| & \ddmmyyyydate\today\\ |
| 5309 |
\verb|\dmyyyydate| & \dmyyyydate\today\\ |
| 5310 |
\verb|\ddmmyydate| & \ddmmyydate\today\\ |
| 5311 |
\verb|\dmyydate| & \dmyydate\today\\ |
| 5312 |
\verb|\textdate| & \textdate\today\\ |
| 5313 |
\verb|\usdate| & \usdate\today\\ |
| 5314 |
\verb|\mmddyyyydate| & \mmddyyyydate\today\\ |
| 5315 |
\verb|\mdyyyydate| & \mdyyyydate\today\\ |
| 5316 |
\verb|\mmddyydate| & \mmddyydate\today\\ |
| 5317 |
\verb|\mdyydate| & \mdyydate\today |
| 5318 |
\end{tabular} |
| 5319 |
|
| 5320 |
\section{Time Formats} |
| 5321 |
Default: \currenttime. |
| 5322 |
|
| 5323 |
\begin{tabular}{@{\ttfamily}ll} |
| 5324 |
\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\ |
| 5325 |
hhmmsstime & \settimeformat{hhmmsstime}\currenttime\\ |
| 5326 |
xxivtime & \settimeformat{xxivtime}\currenttime\\ |
| 5327 |
ampmtime & \settimeformat{ampmtime}\currenttime\\ |
| 5328 |
oclock & \settimeformat{oclock}\currenttime |
| 5329 |
\end{tabular} |
| 5330 |
|
| 5331 |
\section{Specific Date:} |
| 5332 |
|
| 5333 |
\begin{tabular}{ll} |
| 5334 |
\bfseries Format & \bfseries \verb|\formatdate{1}{3}{2009}|\\ |
| 5335 |
\verb|\longdate| & \longdate\formatdate{1}{3}{2000}\\ |
| 5336 |
\verb|\shortdate| & \shortdate\formatdate{1}{3}{2000}\\ |
| 5337 |
\verb|\yyyymmdddate| & \yyyymmdddate\formatdate{1}{3}{2000}\\ |
| 5338 |
\verb|\ddmmyyyydate| & \ddmmyyyydate\formatdate{1}{3}{2000}\\ |
| 5339 |
\verb|\dmyyyydate| & \dmyyyydate\formatdate{1}{3}{2000}\\ |
| 5340 |
\verb|\ddmmyydate| & \ddmmyydate\formatdate{1}{3}{2000}\\ |
| 5341 |
\verb|\dmyydate| & \dmyydate\formatdate{1}{3}{2000}\\ |
| 5342 |
\verb|\textdate| & \textdate\formatdate{1}{3}{2000}\\ |
| 5343 |
\verb|\usdate| & \usdate\formatdate{1}{3}{2000}\\ |
| 5344 |
\verb|\mmddyyyydate| & \mmddyyyydate\formatdate{1}{3}{2000}\\ |
| 5345 |
\verb|\mdyyyydate| & \mdyyyydate\formatdate{1}{3}{2000}\\ |
| 5346 |
\verb|\mmddyydate| & \mmddyydate\formatdate{1}{3}{2000}\\ |
| 5347 |
\verb|\mdyydate| & \mdyydate\formatdate{1}{3}{2000} |
| 5348 |
\end{tabular} |
| 5349 |
|
| 5350 |
\section{Specific Time} |
| 5351 |
|
| 5352 |
\begin{tabular}{@{\ttfamily}ll} |
| 5353 |
\bfseries\rmfamily Format & \bfseries \verb|\formattime{15}{45}{00}|\\ |
| 5354 |
hhmmsstime & \settimeformat{hhmmsstime}\formattime{15}{45}{00}\\ |
| 5355 |
xxivtime & \settimeformat{xxivtime}\formattime{15}{45}{00}\\ |
| 5356 |
ampmtime & \settimeformat{ampmtime}\formattime{15}{45}{00}\\ |
| 5357 |
oclock & \settimeformat{oclock}\formattime{15}{45}{00} |
| 5358 |
\end{tabular} |
| 5359 |
|
| 5360 |
\vskip\baselineskip\noindent |
| 5361 |
\begin{tabular}{@{\ttfamily}ll} |
| 5362 |
\bfseries\rmfamily Format & \bfseries \verb|\formattime{0}{0}{0}|\\ |
| 5363 |
hhmmsstime & \settimeformat{hhmmsstime}\formattime{0}{0}{0}\\ |
| 5364 |
xxivtime & \settimeformat{xxivtime}\formattime{0}{0}{0}\\ |
| 5365 |
ampmtime & \settimeformat{ampmtime}\formattime{0}{0}{0}\\ |
| 5366 |
oclock & \settimeformat{oclock}\formattime{0}{0}{0} |
| 5367 |
\end{tabular} |
| 5368 |
|
| 5369 |
\vskip\baselineskip\noindent |
| 5370 |
\begin{tabular}{@{\ttfamily}ll} |
| 5371 |
\bfseries\rmfamily Format & \bfseries \verb|\formattime{12}{0}{0}|\\ |
| 5372 |
hhmmsstime & \settimeformat{hhmmsstime}\formattime{12}{0}{0}\\ |
| 5373 |
xxivtime & \settimeformat{xxivtime}\formattime{12}{0}{0}\\ |
| 5374 |
ampmtime & \settimeformat{ampmtime}\formattime{12}{0}{0}\\ |
| 5375 |
oclock & \settimeformat{oclock}\formattime{12}{0}{0} |
| 5376 |
\end{tabular} |
| 5377 |
|
| 5378 |
\section{Defining New Dates} |
| 5379 |
|
| 5380 |
\begin{tabular}{ll} |
| 5381 |
\verb|\dashdate| & \dashdate\today\\ |
| 5382 |
\verb|\usvardate| & \usvardate\today\\ |
| 5383 |
\verb|\ukvardate| & \ukvardate\today\\ |
| 5384 |
\verb|\mydate| & \mydate\today\\ |
| 5385 |
\verb|\yyyymmdd| & \yyyymmdd\today\\ |
| 5386 |
\verb|\dashdate| & \dashdate\formatdate{8}{3}{2000}\\ |
| 5387 |
\verb|\usvardate| & \usvardate\formatdate{8}{3}{2000}\\ |
| 5388 |
\verb|\mydate| & \mydate\formatdate{8}{3}{2000}\\ |
| 5389 |
\verb|\yyyymmdd| & \yyyymmdd\formatdate{8}{3}{2000} |
| 5390 |
\end{tabular} |
| 5391 |
|
| 5392 |
\section{Defining New Times} |
| 5393 |
|
| 5394 |
\begin{tabular}{@{\ttfamily}ll} |
| 5395 |
\bfseries\rmfamily Format & \bfseries \verb|\currenttime|\\ |
| 5396 |
dottime & \settimeformat{dottime}\currenttime\\ |
| 5397 |
dashtime12 & \settimeformat{dashtime12}\currenttime\\ |
| 5398 |
hhmm & \settimeformat{hhmm}\currenttime |
| 5399 |
\end{tabular} |
| 5400 |
|
| 5401 |
\end{document} |
| 5402 |
%\fi |
| 5403 |
%\iffalse |
| 5404 |
% \begin{macrocode} |
| 5405 |
%</dt-sampl.tex> |
| 5406 |
% \end{macrocode} |
| 5407 |
%\fi |
| 5408 |
%\iffalse |
| 5409 |
% \begin{macrocode} |
| 5410 |
%<*datetime.perl> |
| 5411 |
% \end{macrocode} |
| 5412 |
%\fi |
| 5413 |
%\iffalse |
| 5414 |
% \begin{macrocode} |
| 5415 |
# File : datetime.perl |
| 5416 |
# Author : Nicola Talbot |
| 5417 |
# Date : 17 Nov 2009 |
| 5418 |
# Version : 1.04 |
| 5419 |
# |
| 5420 |
# This is a LaTeX2HTML style implementing the datetime package, and |
| 5421 |
# is distributed as part of that package. |
| 5422 |
# Copyright 2007 Nicola L.C. Talbot |
| 5423 |
# This work may be distributed and/or modified under the |
| 5424 |
# conditions of the LaTeX Project Public License, either version 1.3 |
| 5425 |
# of this license of (at your option) any later version. |
| 5426 |
# The latest version of this license is in |
| 5427 |
# http://www.latex-project.org/lppl.txt |
| 5428 |
# and version 1.3 or later is part of all distributions of LaTeX |
| 5429 |
# version 2005/12/01 or later. |
| 5430 |
# |
| 5431 |
# This work has the LPPL maintenance status `maintained'. |
| 5432 |
# |
| 5433 |
# The Current Maintainer of this work is Nicola Talbot. |
| 5434 |
|
| 5435 |
# set up default values for internal counters. |
| 5436 |
|
| 5437 |
($global{SECONDS},$global{MINUTE},$global{HOUR},$global{DAY},$global{MONTH},$global{YEAR})=localtime(time); |
| 5438 |
$global{YEAR} += 1900; |
| 5439 |
$global{MONTH}++; |
| 5440 |
|
| 5441 |
package main; |
| 5442 |
|
| 5443 |
&do_require_package('fmtcount'); |
| 5444 |
|
| 5445 |
sub do_cmd_ordinaldate{ |
| 5446 |
&do_cmd_ordinalnum(@_); |
| 5447 |
} |
| 5448 |
|
| 5449 |
# define package options |
| 5450 |
|
| 5451 |
sub do_datetime_long{ |
| 5452 |
&do_cmd_longdate(@_); |
| 5453 |
} |
| 5454 |
|
| 5455 |
sub do_datetime_short{ |
| 5456 |
&do_cmd_shortdate(@_); |
| 5457 |
} |
| 5458 |
|
| 5459 |
sub do_datetime_text{ |
| 5460 |
&do_cmd_textdate(@_); |
| 5461 |
} |
| 5462 |
|
| 5463 |
sub do_datetime_yyyymmdd{ |
| 5464 |
&do_cmd_yyyymmdddate(@_); |
| 5465 |
} |
| 5466 |
|
| 5467 |
sub do_datetime_ddmmyyyy{ |
| 5468 |
&do_cmd_ddmmyyyydate(@_); |
| 5469 |
} |
| 5470 |
|
| 5471 |
sub do_datetime_dmyyyy{ |
| 5472 |
&do_cmd_dmyyyydate(@_); |
| 5473 |
} |
| 5474 |
|
| 5475 |
sub do_datetime_ddmmyy{ |
| 5476 |
&do_cmd_ddmmyydate(@_); |
| 5477 |
} |
| 5478 |
|
| 5479 |
sub do_datetime_dmyy{ |
| 5480 |
&do_cmd_dmyyyydate(@_); |
| 5481 |
} |
| 5482 |
|
| 5483 |
sub do_datetime_us{ |
| 5484 |
&do_cmd_usdate(@_); |
| 5485 |
} |
| 5486 |
|
| 5487 |
sub do_datetime_mmddyyyy{ |
| 5488 |
&do_cmd_mmddyyyydate(@_); |
| 5489 |
} |
| 5490 |
|
| 5491 |
sub do_datetime_mdyyyy{ |
| 5492 |
&do_cmd_mdyyyydate(@_); |
| 5493 |
} |
| 5494 |
|
| 5495 |
sub do_datetime_mmddyy{ |
| 5496 |
&do_cmd_mmddyydate(@_); |
| 5497 |
} |
| 5498 |
|
| 5499 |
sub do_datetime_mdyy{ |
| 5500 |
&do_cmd_mdyyyydate(@_); |
| 5501 |
} |
| 5502 |
|
| 5503 |
sub do_datetime_raise{ |
| 5504 |
local($tmp)=""; |
| 5505 |
|
| 5506 |
$tmp .= 'sub do_cmd_fmtord{'; |
| 5507 |
$tmp .= 'local($_) = @_;'; |
| 5508 |
$tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));'; |
| 5509 |
$tmp .= 'join("", "<SUP>",$num,"</SUP>",$_);'; |
| 5510 |
$tmp .='}'; |
| 5511 |
|
| 5512 |
eval($tmp); |
| 5513 |
} |
| 5514 |
|
| 5515 |
sub do_datetime_level{ |
| 5516 |
local($tmp)=""; |
| 5517 |
|
| 5518 |
$tmp .= 'sub do_cmd_fmtord{'; |
| 5519 |
$tmp .= 'local($_) = @_;'; |
| 5520 |
$tmp .= 'local($num) = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($num=$2));'; |
| 5521 |
$tmp .= 'join("", $num,$_);'; |
| 5522 |
$tmp .='}'; |
| 5523 |
|
| 5524 |
eval($tmp); |
| 5525 |
} |
| 5526 |
|
| 5527 |
sub do_datetime_dayofweek{ |
| 5528 |
&do_cmd_showdowtrue(@_); |
| 5529 |
} |
| 5530 |
|
| 5531 |
sub do_datetime_nodayofweek{ |
| 5532 |
&do_cmd_showdowfalse(@_); |
| 5533 |
} |
| 5534 |
|
| 5535 |
sub do_datetime_hhmmss{ |
| 5536 |
&set_timeformat_hhmmsstime |
| 5537 |
} |
| 5538 |
|
| 5539 |
sub do_datetime_24hr{ |
| 5540 |
&set_timeformat_xxivtime |
| 5541 |
} |
| 5542 |
|
| 5543 |
&do_datetime_24hr; |
| 5544 |
|
| 5545 |
sub do_datetime_12hr{ |
| 5546 |
&set_timeformat_ampmtime |
| 5547 |
} |
| 5548 |
|
| 5549 |
sub do_datetime_oclock{ |
| 5550 |
&set_timeformat_oclock |
| 5551 |
} |
| 5552 |
|
| 5553 |
sub do_datetime_iso{ |
| 5554 |
&set_timeformat_hhmmsstime; |
| 5555 |
&do_cmd_yyyymmdddate; |
| 5556 |
eval('sub do_cmd_dateseparator{join(\'\', \'-\', $_[0]);}'); |
| 5557 |
eval('sub do_cmd_timeseparator{join(\'\', \':\', $_[0]);}'); |
| 5558 |
} |
| 5559 |
|
| 5560 |
# babel stuff (Month will already be redefined by babel, so only need to change $dateformat) |
| 5561 |
|
| 5562 |
sub do_datetime_austrian{ |
| 5563 |
local($tmp) = ""; |
| 5564 |
|
| 5565 |
$tmp .= 'sub do_cmd_dateaustrian{'; |
| 5566 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5567 |
$tmp .= ' $_[0];'; |
| 5568 |
$tmp .= '}'; |
| 5569 |
|
| 5570 |
eval($tmp); |
| 5571 |
|
| 5572 |
&do_cmd_dateaustrian(@_); |
| 5573 |
} |
| 5574 |
|
| 5575 |
if (defined &austrian_today) |
| 5576 |
{ |
| 5577 |
&do_datetime_austrian(@_); |
| 5578 |
} |
| 5579 |
|
| 5580 |
sub do_datetime_bahasa{ |
| 5581 |
local($tmp) = ""; |
| 5582 |
|
| 5583 |
$tmp .= 'sub do_cmd_datebahasa{'; |
| 5584 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 5585 |
$tmp .= ' $_[0];'; |
| 5586 |
$tmp .= '}'; |
| 5587 |
|
| 5588 |
eval($tmp); |
| 5589 |
|
| 5590 |
&do_cmd_datebahasa(@_); |
| 5591 |
} |
| 5592 |
|
| 5593 |
if (defined &bahasa_today) |
| 5594 |
{ |
| 5595 |
&do_datetime_bahasa(@_); |
| 5596 |
} |
| 5597 |
|
| 5598 |
sub do_datetime_basque{ |
| 5599 |
local($tmp) = ""; |
| 5600 |
|
| 5601 |
$tmp .= 'sub do_cmd_datebasque{'; |
| 5602 |
$tmp .= ' $dateformat = "THEYEAR.eko MONTHNAME[THEMONTH] THEDAY";'; |
| 5603 |
$tmp .= ' $_[0];'; |
| 5604 |
$tmp .= '}'; |
| 5605 |
|
| 5606 |
eval($tmp); |
| 5607 |
|
| 5608 |
&do_cmd_datebasque(@_); |
| 5609 |
} |
| 5610 |
|
| 5611 |
if (defined &basque_today) |
| 5612 |
{ |
| 5613 |
&do_datetime_basque(@_); |
| 5614 |
} |
| 5615 |
|
| 5616 |
sub do_datetime_breton{ |
| 5617 |
local($tmp) = ""; |
| 5618 |
|
| 5619 |
$tmp .= 'sub do_cmd_datebreton{'; |
| 5620 |
$tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";'; |
| 5621 |
$tmp .= ' $_[0];'; |
| 5622 |
$tmp .= '}'; |
| 5623 |
|
| 5624 |
eval($tmp); |
| 5625 |
|
| 5626 |
$tmp = 'sub do_cmd_ordinaldate{'; |
| 5627 |
$tmp .= 'local($_) = @_;'; |
| 5628 |
$tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; |
| 5629 |
$tmp .= 'local($before) = $num;'; |
| 5630 |
|
| 5631 |
$tmp .= 'if ($num == 1)'; |
| 5632 |
$tmp .= '{ $before .= \'a\~n\'; }'; |
| 5633 |
|
| 5634 |
$tmp .= '$before . $_[0];'; |
| 5635 |
$tmp .= '}'; |
| 5636 |
|
| 5637 |
eval($tmp); |
| 5638 |
|
| 5639 |
&do_cmd_datebreton(@_); |
| 5640 |
} |
| 5641 |
|
| 5642 |
if (defined &breton_today) |
| 5643 |
{ |
| 5644 |
&do_datetime_breton(@_); |
| 5645 |
} |
| 5646 |
|
| 5647 |
sub do_datetime_bulgarian{ |
| 5648 |
local($tmp) = ""; |
| 5649 |
|
| 5650 |
$tmp .= 'sub do_cmd_datebulgarian{'; |
| 5651 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\cyrg.";'; |
| 5652 |
$tmp .= ' $_[0];'; |
| 5653 |
$tmp .= '}'; |
| 5654 |
|
| 5655 |
eval($tmp); |
| 5656 |
|
| 5657 |
&do_cmd_datebulgarian(@_); |
| 5658 |
} |
| 5659 |
|
| 5660 |
if (defined &bulgarian_today) |
| 5661 |
{ |
| 5662 |
&do_datetime_bulgarian(@_); |
| 5663 |
} |
| 5664 |
|
| 5665 |
sub do_datetime_catalan{ |
| 5666 |
local($tmp) = ""; |
| 5667 |
|
| 5668 |
$tmp .= 'sub do_cmd_datecatalan{'; |
| 5669 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] de THEYEAR";'; |
| 5670 |
$tmp .= ' $_[0];'; |
| 5671 |
$tmp .= '}'; |
| 5672 |
|
| 5673 |
eval($tmp); |
| 5674 |
|
| 5675 |
&do_cmd_datecatalan(@_); |
| 5676 |
} |
| 5677 |
|
| 5678 |
if (defined &catalan_today) |
| 5679 |
{ |
| 5680 |
&do_datetime_catalan(@_); |
| 5681 |
} |
| 5682 |
|
| 5683 |
sub do_datetime_croatian{ |
| 5684 |
local($tmp) = ""; |
| 5685 |
|
| 5686 |
$tmp .= 'sub do_cmd_datecroatian{'; |
| 5687 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";'; |
| 5688 |
$tmp .= ' $_[0];'; |
| 5689 |
$tmp .= '}'; |
| 5690 |
|
| 5691 |
eval($tmp); |
| 5692 |
|
| 5693 |
&do_cmd_datecroatian(@_); |
| 5694 |
} |
| 5695 |
|
| 5696 |
if (defined &croatian_today) |
| 5697 |
{ |
| 5698 |
&do_datetime_croatian(@_); |
| 5699 |
} |
| 5700 |
|
| 5701 |
sub do_datetime_czech{ |
| 5702 |
local($tmp) = ""; |
| 5703 |
|
| 5704 |
$tmp .= 'sub do_cmd_dateczech{'; |
| 5705 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5706 |
$tmp .= ' $_[0];'; |
| 5707 |
$tmp .= '}'; |
| 5708 |
|
| 5709 |
eval($tmp); |
| 5710 |
|
| 5711 |
&do_cmd_dateczech(@_); |
| 5712 |
} |
| 5713 |
|
| 5714 |
if (defined &czech_today) |
| 5715 |
{ |
| 5716 |
&do_datetime_czech(@_); |
| 5717 |
} |
| 5718 |
|
| 5719 |
sub do_datetime_danish{ |
| 5720 |
local($tmp) = ""; |
| 5721 |
|
| 5722 |
$tmp .= 'sub do_cmd_datedanish{'; |
| 5723 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5724 |
$tmp .= ' $_[0];'; |
| 5725 |
$tmp .= '}'; |
| 5726 |
|
| 5727 |
eval($tmp); |
| 5728 |
|
| 5729 |
&do_cmd_datedanish(@_); |
| 5730 |
} |
| 5731 |
|
| 5732 |
if (defined &danish_today) |
| 5733 |
{ |
| 5734 |
&do_datetime_danish(@_); |
| 5735 |
} |
| 5736 |
|
| 5737 |
sub do_datetime_dutch{ |
| 5738 |
local($tmp) = ""; |
| 5739 |
|
| 5740 |
$tmp .= 'sub do_cmd_datedutch{'; |
| 5741 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 5742 |
$tmp .= ' $_[0];'; |
| 5743 |
$tmp .= '}'; |
| 5744 |
|
| 5745 |
eval($tmp); |
| 5746 |
|
| 5747 |
&do_cmd_datedutch(@_); |
| 5748 |
} |
| 5749 |
|
| 5750 |
if (defined &dutch_today) |
| 5751 |
{ |
| 5752 |
&do_datetime_dutch(@_); |
| 5753 |
} |
| 5754 |
|
| 5755 |
sub do_datetime_esperanto{ |
| 5756 |
local($tmp) = ""; |
| 5757 |
|
| 5758 |
$tmp .= 'sub do_cmd_dateesperanto{'; |
| 5759 |
$tmp .= ' $dateformat = "THEDAY--a de MONTHNAME[THEMONTH], THEYEAR";'; |
| 5760 |
$tmp .= ' $_[0];'; |
| 5761 |
$tmp .= '}'; |
| 5762 |
|
| 5763 |
eval($tmp); |
| 5764 |
|
| 5765 |
&do_cmd_dateesperanto(@_); |
| 5766 |
} |
| 5767 |
|
| 5768 |
if (defined &esperanto_today) |
| 5769 |
{ |
| 5770 |
&do_datetime_esperanto(@_); |
| 5771 |
} |
| 5772 |
|
| 5773 |
sub do_datetime_estonian{ |
| 5774 |
local($tmp) = ""; |
| 5775 |
|
| 5776 |
$tmp .= 'sub do_cmd_dateestonian{'; |
| 5777 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR. a.";'; |
| 5778 |
$tmp .= ' $_[0];'; |
| 5779 |
$tmp .= '}'; |
| 5780 |
|
| 5781 |
eval($tmp); |
| 5782 |
|
| 5783 |
&do_cmd_dateestonian(@_); |
| 5784 |
} |
| 5785 |
|
| 5786 |
if (defined &estonian_today) |
| 5787 |
{ |
| 5788 |
&do_datetime_estonian(@_); |
| 5789 |
} |
| 5790 |
|
| 5791 |
sub do_datetime_finnish{ |
| 5792 |
local($tmp) = ""; |
| 5793 |
|
| 5794 |
$tmp .= 'sub do_cmd_datefinnish{'; |
| 5795 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5796 |
$tmp .= ' $_[0];'; |
| 5797 |
$tmp .= '}'; |
| 5798 |
|
| 5799 |
eval($tmp); |
| 5800 |
|
| 5801 |
&do_cmd_datefinnish(@_); |
| 5802 |
} |
| 5803 |
|
| 5804 |
if (defined &finnish_today) |
| 5805 |
{ |
| 5806 |
&do_datetime_finnish(@_); |
| 5807 |
} |
| 5808 |
|
| 5809 |
sub do_datetime_french{ |
| 5810 |
local($tmp) = ""; |
| 5811 |
|
| 5812 |
eval($tmp); |
| 5813 |
$tmp .= 'sub do_cmd_datefrench{'; |
| 5814 |
$tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH] THEYEAR";'; |
| 5815 |
$tmp .= ' $_[0];'; |
| 5816 |
$tmp .= '}'; |
| 5817 |
|
| 5818 |
eval($tmp); |
| 5819 |
|
| 5820 |
$tmp = 'sub do_cmd_ordinaldate{'; |
| 5821 |
$tmp .= 'local($_) = @_;'; |
| 5822 |
$tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; |
| 5823 |
$tmp .= 'local($before) = $num;'; |
| 5824 |
|
| 5825 |
$tmp .= 'if ($num == 1)'; |
| 5826 |
$tmp .= '{ $before .= \'\ier\'; }'; |
| 5827 |
|
| 5828 |
$tmp .= '$before . $_[0];'; |
| 5829 |
$tmp .= '}'; |
| 5830 |
|
| 5831 |
eval($tmp); |
| 5832 |
|
| 5833 |
&do_cmd_datefrench(@_); |
| 5834 |
} |
| 5835 |
|
| 5836 |
if (defined &french_today) |
| 5837 |
{ |
| 5838 |
&do_datetime_french(@_); |
| 5839 |
} |
| 5840 |
|
| 5841 |
sub do_datetime_galician{ |
| 5842 |
local($tmp) = ""; |
| 5843 |
|
| 5844 |
$tmp .= 'sub do_cmd_dategalician{'; |
| 5845 |
$tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";'; |
| 5846 |
$tmp .= ' $_[0];'; |
| 5847 |
$tmp .= '}'; |
| 5848 |
|
| 5849 |
eval($tmp); |
| 5850 |
|
| 5851 |
&do_cmd_dategalician(@_); |
| 5852 |
} |
| 5853 |
|
| 5854 |
if (defined &galician_today) |
| 5855 |
{ |
| 5856 |
&do_datetime_galician(@_); |
| 5857 |
} |
| 5858 |
|
| 5859 |
sub do_datetime_german{ |
| 5860 |
local($tmp) = ""; |
| 5861 |
|
| 5862 |
$tmp .= 'sub do_cmd_dategerman{'; |
| 5863 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5864 |
$tmp .= ' $_[0];'; |
| 5865 |
$tmp .= '}'; |
| 5866 |
|
| 5867 |
eval($tmp); |
| 5868 |
|
| 5869 |
&do_cmd_dategerman(@_); |
| 5870 |
} |
| 5871 |
|
| 5872 |
if (defined &german_today) |
| 5873 |
{ |
| 5874 |
&do_datetime_german(@_); |
| 5875 |
} |
| 5876 |
|
| 5877 |
sub do_datetime_greek{ |
| 5878 |
local($tmp) = ""; |
| 5879 |
|
| 5880 |
$tmp .= 'sub do_cmd_dategreek{'; |
| 5881 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 5882 |
$tmp .= ' $_[0];'; |
| 5883 |
$tmp .= '}'; |
| 5884 |
|
| 5885 |
eval($tmp); |
| 5886 |
|
| 5887 |
&do_cmd_dategreek(@_); |
| 5888 |
} |
| 5889 |
|
| 5890 |
if (defined &greek_today) |
| 5891 |
{ |
| 5892 |
&do_datetime_greek(@_); |
| 5893 |
} |
| 5894 |
|
| 5895 |
sub do_datetime_icelandic{ |
| 5896 |
local($tmp) = ""; |
| 5897 |
|
| 5898 |
$tmp .= 'sub do_cmd_dateicelandic{'; |
| 5899 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5900 |
$tmp .= ' $_[0];'; |
| 5901 |
$tmp .= '}'; |
| 5902 |
|
| 5903 |
eval($tmp); |
| 5904 |
|
| 5905 |
&do_cmd_dateicelandic(@_); |
| 5906 |
} |
| 5907 |
|
| 5908 |
if (defined &icelandic_today) |
| 5909 |
{ |
| 5910 |
&do_datetime_icelandic(@_); |
| 5911 |
} |
| 5912 |
|
| 5913 |
sub do_datetime_irish{ |
| 5914 |
local($tmp) = ""; |
| 5915 |
|
| 5916 |
$tmp .= 'sub do_cmd_dateirish{'; |
| 5917 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 5918 |
$tmp .= ' $_[0];'; |
| 5919 |
$tmp .= '}'; |
| 5920 |
|
| 5921 |
eval($tmp); |
| 5922 |
|
| 5923 |
&do_cmd_dateirish(@_); |
| 5924 |
} |
| 5925 |
|
| 5926 |
if (defined &irish_today) |
| 5927 |
{ |
| 5928 |
&do_datetime_irish(@_); |
| 5929 |
} |
| 5930 |
|
| 5931 |
sub do_datetime_italian{ |
| 5932 |
local($tmp) = ""; |
| 5933 |
|
| 5934 |
$tmp .= 'sub do_cmd_dateitalian{'; |
| 5935 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 5936 |
$tmp .= ' $_[0];'; |
| 5937 |
$tmp .= '}'; |
| 5938 |
|
| 5939 |
eval($tmp); |
| 5940 |
|
| 5941 |
&do_cmd_dateitalian(@_); |
| 5942 |
} |
| 5943 |
|
| 5944 |
if (defined &italian_today) |
| 5945 |
{ |
| 5946 |
&do_datetime_italian(@_); |
| 5947 |
} |
| 5948 |
|
| 5949 |
sub do_datetime_latin{ |
| 5950 |
local($tmp) = ""; |
| 5951 |
|
| 5952 |
$tmp .= 'sub do_cmd_datelatin{'; |
| 5953 |
$tmp .= ' $dateformat = "ROMANNUMERALU{THEDAY} MONTHNAME[THEMONTH] ROMANNUMERALU{THEYEAR}";'; |
| 5954 |
$tmp .= ' $_[0];'; |
| 5955 |
$tmp .= '}'; |
| 5956 |
|
| 5957 |
eval($tmp); |
| 5958 |
|
| 5959 |
&do_cmd_datelatin(@_); |
| 5960 |
} |
| 5961 |
|
| 5962 |
if (defined &latin_today) |
| 5963 |
{ |
| 5964 |
&do_datetime_latin(@_); |
| 5965 |
} |
| 5966 |
|
| 5967 |
sub do_datetime_lsorbian{ |
| 5968 |
local($tmp) = ""; |
| 5969 |
|
| 5970 |
$tmp .= 'sub do_cmd_datelsorbian{'; |
| 5971 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 5972 |
$tmp .= ' $_[0];'; |
| 5973 |
$tmp .= '}'; |
| 5974 |
|
| 5975 |
eval($tmp); |
| 5976 |
|
| 5977 |
&do_cmd_datelsorbian(@_); |
| 5978 |
} |
| 5979 |
|
| 5980 |
if (defined &lsorbian_today) |
| 5981 |
{ |
| 5982 |
&do_datetime_lsorbian(@_); |
| 5983 |
} |
| 5984 |
|
| 5985 |
sub do_datetime_magyar{ |
| 5986 |
local($tmp) = ""; |
| 5987 |
|
| 5988 |
$tmp .= 'sub do_cmd_datemagyar{'; |
| 5989 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR.";'; |
| 5990 |
$tmp .= ' $_[0];'; |
| 5991 |
$tmp .= '}'; |
| 5992 |
|
| 5993 |
eval($tmp); |
| 5994 |
|
| 5995 |
&do_cmd_datemagyar(@_); |
| 5996 |
} |
| 5997 |
|
| 5998 |
if (defined &magyar_today) |
| 5999 |
{ |
| 6000 |
&do_datetime_magyar(@_); |
| 6001 |
} |
| 6002 |
|
| 6003 |
sub do_datetime_naustrian{ |
| 6004 |
local($tmp) = ""; |
| 6005 |
|
| 6006 |
$tmp .= 'sub do_cmd_datenaustrian{'; |
| 6007 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6008 |
$tmp .= ' $_[0];'; |
| 6009 |
$tmp .= '}'; |
| 6010 |
|
| 6011 |
eval($tmp); |
| 6012 |
|
| 6013 |
&do_cmd_datenaustrian(@_); |
| 6014 |
} |
| 6015 |
|
| 6016 |
if (defined &naustrian_today) |
| 6017 |
{ |
| 6018 |
&do_datetime_naustrian(@_); |
| 6019 |
} |
| 6020 |
|
| 6021 |
sub do_datetime_ngerman{ |
| 6022 |
local($tmp) = ""; |
| 6023 |
|
| 6024 |
$tmp .= 'sub do_cmd_datengerman{'; |
| 6025 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6026 |
$tmp .= ' $_[0];'; |
| 6027 |
$tmp .= '}'; |
| 6028 |
|
| 6029 |
eval($tmp); |
| 6030 |
|
| 6031 |
&do_cmd_datengerman(@_); |
| 6032 |
} |
| 6033 |
|
| 6034 |
if (defined &ngerman_today) |
| 6035 |
{ |
| 6036 |
&do_datetime_ngerman(@_); |
| 6037 |
} |
| 6038 |
|
| 6039 |
sub do_datetime_norsk{ |
| 6040 |
local($tmp) = ""; |
| 6041 |
|
| 6042 |
$tmp .= 'sub do_cmd_datenorsk{'; |
| 6043 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6044 |
$tmp .= ' $_[0];'; |
| 6045 |
$tmp .= '}'; |
| 6046 |
|
| 6047 |
eval($tmp); |
| 6048 |
|
| 6049 |
&do_cmd_datenorsk(@_); |
| 6050 |
} |
| 6051 |
|
| 6052 |
if (defined &norsk_today) |
| 6053 |
{ |
| 6054 |
&do_datetime_norsk(@_); |
| 6055 |
} |
| 6056 |
|
| 6057 |
sub do_datetime_polish{ |
| 6058 |
local($tmp) = ""; |
| 6059 |
|
| 6060 |
$tmp .= 'sub do_cmd_datenorsk{'; |
| 6061 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 6062 |
$tmp .= ' $_[0];'; |
| 6063 |
$tmp .= '}'; |
| 6064 |
|
| 6065 |
eval($tmp); |
| 6066 |
|
| 6067 |
&do_cmd_datenorsk(@_); |
| 6068 |
} |
| 6069 |
|
| 6070 |
if (defined &polish_today) |
| 6071 |
{ |
| 6072 |
&do_datetime_polish(@_); |
| 6073 |
} |
| 6074 |
|
| 6075 |
sub do_datetime_portuges{ |
| 6076 |
local($tmp) = ""; |
| 6077 |
|
| 6078 |
$tmp .= 'sub do_cmd_dateportuges{'; |
| 6079 |
$tmp .= ' $dateformat = "THEDAY de MONTHNAME[THEMONTH] de THEYEAR";'; |
| 6080 |
$tmp .= ' $_[0];'; |
| 6081 |
$tmp .= '}'; |
| 6082 |
|
| 6083 |
eval($tmp); |
| 6084 |
|
| 6085 |
&do_cmd_dateportuges(@_); |
| 6086 |
} |
| 6087 |
|
| 6088 |
if (defined &portuges_today) |
| 6089 |
{ |
| 6090 |
&do_datetime_portuges(@_); |
| 6091 |
} |
| 6092 |
|
| 6093 |
sub do_datetime_romanian{ |
| 6094 |
local($tmp) = ""; |
| 6095 |
|
| 6096 |
$tmp .= 'sub do_cmd_dateromanian{'; |
| 6097 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 6098 |
$tmp .= ' $_[0];'; |
| 6099 |
$tmp .= '}'; |
| 6100 |
|
| 6101 |
eval($tmp); |
| 6102 |
|
| 6103 |
&do_cmd_dateromanian(@_); |
| 6104 |
} |
| 6105 |
|
| 6106 |
if (defined &romanian_today) |
| 6107 |
{ |
| 6108 |
&do_datetime_romanian(@_); |
| 6109 |
} |
| 6110 |
|
| 6111 |
sub do_datetime_russian{ |
| 6112 |
local($tmp) = ""; |
| 6113 |
|
| 6114 |
$tmp .= 'sub do_cmd_daterussian{'; |
| 6115 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR \\\\cyrg.";'; |
| 6116 |
$tmp .= ' $_[0];'; |
| 6117 |
$tmp .= '}'; |
| 6118 |
|
| 6119 |
eval($tmp); |
| 6120 |
|
| 6121 |
&do_cmd_daterussian(@_); |
| 6122 |
} |
| 6123 |
|
| 6124 |
if (defined &russian_today) |
| 6125 |
{ |
| 6126 |
&do_datetime_russian(@_); |
| 6127 |
} |
| 6128 |
|
| 6129 |
sub do_datetime_samin{ |
| 6130 |
local($tmp) = ""; |
| 6131 |
|
| 6132 |
$tmp .= 'sub do_cmd_datesamin{'; |
| 6133 |
$tmp .= ' $dateformat = "MONTHNAME[THEMONTH] THEDAY.~b. THEYEAR";'; |
| 6134 |
$tmp .= ' $_[0];'; |
| 6135 |
$tmp .= '}'; |
| 6136 |
|
| 6137 |
eval($tmp); |
| 6138 |
|
| 6139 |
&do_cmd_datesamin(@_); |
| 6140 |
} |
| 6141 |
|
| 6142 |
if (defined &samin_today) |
| 6143 |
{ |
| 6144 |
&do_datetime_samin(@_); |
| 6145 |
} |
| 6146 |
|
| 6147 |
sub do_datetime_scottish{ |
| 6148 |
local($tmp) = ""; |
| 6149 |
|
| 6150 |
$tmp .= 'sub do_cmd_datescottish{'; |
| 6151 |
$tmp .= ' $dateformat = "THEDAY MONTHNAME[THEMONTH] THEYEAR";'; |
| 6152 |
$tmp .= ' $_[0];'; |
| 6153 |
$tmp .= '}'; |
| 6154 |
|
| 6155 |
eval($tmp); |
| 6156 |
|
| 6157 |
&do_cmd_datescottish(@_); |
| 6158 |
} |
| 6159 |
|
| 6160 |
if (defined &scottish_today) |
| 6161 |
{ |
| 6162 |
&do_datetime_scottish(@_); |
| 6163 |
} |
| 6164 |
|
| 6165 |
sub do_datetime_serbian{ |
| 6166 |
local($tmp) = ""; |
| 6167 |
|
| 6168 |
$tmp .= 'sub do_cmd_dateserbian{'; |
| 6169 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6170 |
$tmp .= ' $_[0];'; |
| 6171 |
$tmp .= '}'; |
| 6172 |
|
| 6173 |
eval($tmp); |
| 6174 |
|
| 6175 |
&do_cmd_dateserbian(@_); |
| 6176 |
} |
| 6177 |
|
| 6178 |
if (defined &serbian_today) |
| 6179 |
{ |
| 6180 |
&do_datetime_serbian(@_); |
| 6181 |
} |
| 6182 |
|
| 6183 |
sub do_datetime_slovak{ |
| 6184 |
local($tmp) = ""; |
| 6185 |
|
| 6186 |
$tmp .= 'sub do_cmd_dateslovak{'; |
| 6187 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6188 |
$tmp .= ' $_[0];'; |
| 6189 |
$tmp .= '}'; |
| 6190 |
|
| 6191 |
eval($tmp); |
| 6192 |
|
| 6193 |
&do_cmd_dateslovak(@_); |
| 6194 |
} |
| 6195 |
|
| 6196 |
if (defined &slovak_today) |
| 6197 |
{ |
| 6198 |
&do_datetime_slovak(@_); |
| 6199 |
} |
| 6200 |
|
| 6201 |
sub do_datetime_slovene{ |
| 6202 |
local($tmp) = ""; |
| 6203 |
|
| 6204 |
$tmp .= 'sub do_cmd_dateslovene{'; |
| 6205 |
$tmp .= ' $dateformat = "THEDAY. MONTHNAME[THEMONTH] THEYEAR";'; |
| 6206 |
$tmp .= ' $_[0];'; |
| 6207 |
$tmp .= '}'; |
| 6208 |
|
| 6209 |
eval($tmp); |
| 6210 |
|
| 6211 |
&do_cmd_dateslovene(@_); |
| 6212 |
} |
| 6213 |
|
| 6214 |
if (defined &slovene_today) |
| 6215 |
{ |
| 6216 |
&do_datetime_slovene(@_); |
| 6217 |
} |
| 6218 |
|
| 6219 |
sub do_datetime_spanish{ |
| 6220 |
local($tmp) = ""; |
| 6221 |
|
| 6222 |
$tmp .= 'sub do_cmd_datespanish{'; |
| 6223 |
$tmp .= ' $dateformat = "THEDAY~de MONTHNAME[THEMONTH] de~THEYEAR";'; |
| 6224 |
$tmp .= ' $_[0];'; |
| 6225 |
$tmp .= '}'; |
| 6226 |
|
| 6227 |
eval($tmp); |
| 6228 |
|
| 6229 |
&do_cmd_datespanish(@_); |
| 6230 |
} |
| 6231 |
|
| 6232 |
if (defined &spanish_today) |
| 6233 |
{ |
| 6234 |
&do_datetime_spanish(@_); |
| 6235 |
} |
| 6236 |
|
| 6237 |
sub do_datetime_swedish{ |
| 6238 |
local($tmp) = ""; |
| 6239 |
|
| 6240 |
$tmp .= 'sub do_cmd_dateswedish{'; |
| 6241 |
$tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";'; |
| 6242 |
$tmp .= ' $_[0];'; |
| 6243 |
$tmp .= '}'; |
| 6244 |
|
| 6245 |
eval($tmp); |
| 6246 |
|
| 6247 |
$tmp = ""; |
| 6248 |
$tmp .= 'sub do_cmd_datesymd{'; |
| 6249 |
$tmp .= ' $dateformat = "THEYEAR-TWODIGIT{THEMONTH}-TWODIGIT{THEDAY}";'; |
| 6250 |
$tmp .= ' $_[0];'; |
| 6251 |
$tmp .= '}'; |
| 6252 |
|
| 6253 |
eval($tmp); |
| 6254 |
|
| 6255 |
$tmp = ""; |
| 6256 |
$tmp .= 'sub do_cmd_datesdmy{'; |
| 6257 |
$tmp .= ' $dateformat = "THEDAY/THEMONTH THEYEAR";'; |
| 6258 |
$tmp .= ' $_[0];'; |
| 6259 |
$tmp .= '}'; |
| 6260 |
|
| 6261 |
eval($tmp); |
| 6262 |
|
| 6263 |
&do_cmd_dateswedish(@_); |
| 6264 |
} |
| 6265 |
|
| 6266 |
if (defined &swedish_today) |
| 6267 |
{ |
| 6268 |
&do_datetime_swedish(@_); |
| 6269 |
} |
| 6270 |
|
| 6271 |
sub do_datetime_turkish{ |
| 6272 |
local($tmp) = ""; |
| 6273 |
|
| 6274 |
$tmp .= 'sub do_cmd_dateturkish{'; |
| 6275 |
$tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR";'; |
| 6276 |
$tmp .= ' $_[0];'; |
| 6277 |
$tmp .= '}'; |
| 6278 |
|
| 6279 |
eval($tmp); |
| 6280 |
|
| 6281 |
&do_cmd_dateturkish(@_); |
| 6282 |
} |
| 6283 |
|
| 6284 |
if (defined &turkish_today) |
| 6285 |
{ |
| 6286 |
&do_datetime_turkish(@_); |
| 6287 |
} |
| 6288 |
|
| 6289 |
sub do_datetime_ukraineb{ |
| 6290 |
local($tmp) = ""; |
| 6291 |
|
| 6292 |
$tmp .= 'sub do_cmd_dateukraineb{'; |
| 6293 |
$tmp .= ' $dateformat = "THEDAY~MONTHNAME[THEMONTH] THEYEAR~\\\\cyrr.";'; |
| 6294 |
$tmp .= ' $_[0];'; |
| 6295 |
$tmp .= '}'; |
| 6296 |
|
| 6297 |
eval($tmp); |
| 6298 |
|
| 6299 |
&do_cmd_dateukraineb(@_); |
| 6300 |
} |
| 6301 |
|
| 6302 |
if (defined &ukraineb_today) |
| 6303 |
{ |
| 6304 |
&do_datetime_ukraineb(@_); |
| 6305 |
} |
| 6306 |
|
| 6307 |
sub do_datetime_usorbian{ |
| 6308 |
local($tmp) = ""; |
| 6309 |
|
| 6310 |
$tmp .= 'sub do_cmd_dateusorbian{'; |
| 6311 |
$tmp .= ' $dateformat = "THEDAY.~MONTHNAME[THEMONTH] THEYEAR";'; |
| 6312 |
$tmp .= ' $_[0];'; |
| 6313 |
$tmp .= '}'; |
| 6314 |
|
| 6315 |
eval($tmp); |
| 6316 |
|
| 6317 |
&do_cmd_dateusorbian(@_); |
| 6318 |
} |
| 6319 |
|
| 6320 |
if (defined &usorbian_today) |
| 6321 |
{ |
| 6322 |
&do_datetime_usorbian(@_); |
| 6323 |
} |
| 6324 |
|
| 6325 |
sub do_datetime_welsh{ |
| 6326 |
local($tmp) = ""; |
| 6327 |
|
| 6328 |
$tmp .= 'sub do_cmd_datewelsh{'; |
| 6329 |
$tmp .= ' $dateformat = "{ORDINALDATE{DAY}}\\ a viz MONTHNAME[THEMONTH] THEYEAR";'; |
| 6330 |
$tmp .= ' $_[0];'; |
| 6331 |
$tmp .= '}'; |
| 6332 |
|
| 6333 |
eval($tmp); |
| 6334 |
|
| 6335 |
$tmp = 'sub do_cmd_ordinaldate{'; |
| 6336 |
$tmp .= 'local($_) = @_;'; |
| 6337 |
$tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; |
| 6338 |
$tmp .= 'local($before) = $num;'; |
| 6339 |
|
| 6340 |
$tmp .= 'if ($num == 1)'; |
| 6341 |
$tmp .= '{ $before .= \'a\~n\'; }'; |
| 6342 |
|
| 6343 |
$tmp .= '$before . $_[0];'; |
| 6344 |
$tmp .= '}'; |
| 6345 |
|
| 6346 |
eval($tmp); |
| 6347 |
|
| 6348 |
&do_cmd_datewelsh(@_); |
| 6349 |
} |
| 6350 |
|
| 6351 |
if (defined &welsh_today) |
| 6352 |
{ |
| 6353 |
&do_datetime_welsh(@_); |
| 6354 |
} |
| 6355 |
|
| 6356 |
# As far as I know, LaTeX2HTML doesn't implement TeX conditionals. |
| 6357 |
# $showdow corresponds to LaTeX boolean variable showdow |
| 6358 |
$showdow = 1; |
| 6359 |
|
| 6360 |
sub get_monthname{ |
| 6361 |
local($month) = @_; |
| 6362 |
|
| 6363 |
if ($month eq 'THEMONTH' or $month eq '\THEMONTH') |
| 6364 |
{ |
| 6365 |
# this is a cludge to help newdateformat work |
| 6366 |
|
| 6367 |
'MONTHNAME[THEMONTH]'; |
| 6368 |
} |
| 6369 |
else |
| 6370 |
{ |
| 6371 |
if ($month eq '') |
| 6372 |
{ |
| 6373 |
local($today) = &get_date(); |
| 6374 |
$today =~ m|(\d+)/0?(\d+)/|; |
| 6375 |
$month = $1; |
| 6376 |
} |
| 6377 |
|
| 6378 |
$Month[$month]; |
| 6379 |
} |
| 6380 |
} |
| 6381 |
|
| 6382 |
sub do_cmd_monthname{ |
| 6383 |
local($_) = @_; |
| 6384 |
local($month,$pat) = &get_next_optional_argument; |
| 6385 |
|
| 6386 |
local($monthname) = &get_monthname($month); |
| 6387 |
join('',$monthname,$_); |
| 6388 |
} |
| 6389 |
|
| 6390 |
sub get_shortmonthname{ |
| 6391 |
local($month) = @_; |
| 6392 |
|
| 6393 |
if ($month eq 'THEMONTH' or $month eq '\THEMONTH') |
| 6394 |
{ |
| 6395 |
'SHORTMONTHNAME[THEMONTH]'; |
| 6396 |
} |
| 6397 |
else |
| 6398 |
{ |
| 6399 |
substr(&get_monthname($month), 0, 3); |
| 6400 |
} |
| 6401 |
} |
| 6402 |
|
| 6403 |
sub do_cmd_shortmonthname{ |
| 6404 |
local($_) = @_; |
| 6405 |
local($month,$pat) = &get_next_optional_argument; |
| 6406 |
|
| 6407 |
local($monthname) = &get_shortmonthname($month); |
| 6408 |
|
| 6409 |
join('',$monthname,$_); |
| 6410 |
} |
| 6411 |
|
| 6412 |
sub is_leap_year{ |
| 6413 |
local($year) = @_; |
| 6414 |
local($isleapyear) = 0; |
| 6415 |
|
| 6416 |
if (($year%400) == 0) |
| 6417 |
{ |
| 6418 |
# year mod 400 = 0 => leap year |
| 6419 |
|
| 6420 |
$isleapyear = 1; |
| 6421 |
} |
| 6422 |
elsif (($year%100) == 0) |
| 6423 |
{ |
| 6424 |
# year mod 100 = 0 and year mod 400 != 0 => not a leap year |
| 6425 |
|
| 6426 |
$isleapyear = 0; |
| 6427 |
} |
| 6428 |
elsif (($year%4) == 0) |
| 6429 |
{ |
| 6430 |
# year mod 4 = 0 and year mod 100 != 0 => leap year |
| 6431 |
|
| 6432 |
$isleapyear = 1; |
| 6433 |
} |
| 6434 |
|
| 6435 |
$isleapyear; |
| 6436 |
} |
| 6437 |
|
| 6438 |
sub get_day_of_year{ |
| 6439 |
local($day,$month,$year) = @_; |
| 6440 |
local($dayofyear) = 0; |
| 6441 |
|
| 6442 |
SWITCH: { |
| 6443 |
if ($month == 2) {$dayofyear += 31; last SWITCH; } |
| 6444 |
if ($month == 3) {$dayofyear += 59; last SWITCH; } |
| 6445 |
if ($month == 4) {$dayofyear += 90; last SWITCH; } |
| 6446 |
if ($month == 5) {$dayofyear += 120; last SWITCH; } |
| 6447 |
if ($month == 6) {$dayofyear += 151; last SWITCH; } |
| 6448 |
if ($month == 7) {$dayofyear += 181; last SWITCH; } |
| 6449 |
if ($month == 8) {$dayofyear += 212; last SWITCH; } |
| 6450 |
if ($month == 9) {$dayofyear += 243; last SWITCH; } |
| 6451 |
if ($month == 10) {$dayofyear += 273; last SWITCH; } |
| 6452 |
if ($month == 11) {$dayofyear += 304; last SWITCH; } |
| 6453 |
if ($month == 12) {$dayofyear += 334; last SWITCH; } |
| 6454 |
} |
| 6455 |
|
| 6456 |
if ($month > 2 && &is_leap_year($year)) |
| 6457 |
{ |
| 6458 |
$dayofyear += 1; |
| 6459 |
} |
| 6460 |
|
| 6461 |
$dayofyear += $day; |
| 6462 |
local($_)=$dayofyear; |
| 6463 |
} |
| 6464 |
|
| 6465 |
sub get_day_of_week{ |
| 6466 |
local($day,$month,$year) = @_; |
| 6467 |
local($dayofyear) = &get_day_of_year($day,$month,$year); |
| 6468 |
local($_) = (((($year-1901)%28)*1.25 + 2)%7 + $dayofyear - 1)%7 + 1; |
| 6469 |
} |
| 6470 |
|
| 6471 |
sub get_day_of_weekname_english{ |
| 6472 |
local($dow) = @_; |
| 6473 |
|
| 6474 |
local(@DayOfWeek) = ('Sunday', |
| 6475 |
'Monday', |
| 6476 |
'Tuesday', |
| 6477 |
'Wednesday', |
| 6478 |
'Thursday', |
| 6479 |
'Friday', |
| 6480 |
'Saturday'); |
| 6481 |
|
| 6482 |
if ($dow <= 0 || $dow > 7) |
| 6483 |
{ |
| 6484 |
&write_warnings("Invalid day of week number: $dow"); |
| 6485 |
} |
| 6486 |
else |
| 6487 |
{ |
| 6488 |
$DayOfWeek[$dow-1]; |
| 6489 |
} |
| 6490 |
} |
| 6491 |
|
| 6492 |
sub get_day_of_weekname_french{ |
| 6493 |
local($dow) = @_; |
| 6494 |
|
| 6495 |
local(@DayOfWeek) = ('dimanche', |
| 6496 |
'lundi', |
| 6497 |
'mardi', |
| 6498 |
'mercredi', |
| 6499 |
'jeudi', |
| 6500 |
'vendredi', |
| 6501 |
'samedi'); |
| 6502 |
|
| 6503 |
if ($dow <= 0 || $dow > 7) |
| 6504 |
{ |
| 6505 |
&write_warnings("Invalid day of week number: $dow"); |
| 6506 |
} |
| 6507 |
else |
| 6508 |
{ |
| 6509 |
$DayOfWeek[$dow-1]; |
| 6510 |
} |
| 6511 |
} |
| 6512 |
|
| 6513 |
sub get_day_of_weekname_spanish{ |
| 6514 |
local($dow) = @_; |
| 6515 |
|
| 6516 |
local(@DayOfWeek) = ('domingo', |
| 6517 |
'lunes', |
| 6518 |
'martes', |
| 6519 |
'mi\\\'ercoles', |
| 6520 |
'jueves', |
| 6521 |
'viernes', |
| 6522 |
's\\\'abado'); |
| 6523 |
|
| 6524 |
if ($dow <= 0 || $dow > 7) |
| 6525 |
{ |
| 6526 |
&write_warnings("Invalid day of week number: $dow"); |
| 6527 |
} |
| 6528 |
else |
| 6529 |
{ |
| 6530 |
$DayOfWeek[$dow-1]; |
| 6531 |
} |
| 6532 |
} |
| 6533 |
|
| 6534 |
sub get_day_of_weekname_portuges{ |
| 6535 |
local($dow) = @_; |
| 6536 |
|
| 6537 |
local(@DayOfWeek) = ('domingo', |
| 6538 |
'segunda-feira', |
| 6539 |
'ter\c{c}a-feira', |
| 6540 |
'quarta-feira', |
| 6541 |
'quinta-feira', |
| 6542 |
'sexta-feira', |
| 6543 |
'sabado'); |
| 6544 |
|
| 6545 |
if ($dow <= 0 || $dow > 7) |
| 6546 |
{ |
| 6547 |
&write_warnings("Invalid day of week number: $dow"); |
| 6548 |
} |
| 6549 |
else |
| 6550 |
{ |
| 6551 |
$DayOfWeek[$dow-1]; |
| 6552 |
} |
| 6553 |
} |
| 6554 |
|
| 6555 |
sub get_day_of_weekname_german{ |
| 6556 |
local($dow) = @_; |
| 6557 |
|
| 6558 |
local(@DayOfWeek) = ('Sonntag', |
| 6559 |
'Montag', |
| 6560 |
'Dienstag', |
| 6561 |
'Mittwoch', |
| 6562 |
'Donnerstag', |
| 6563 |
'Freitag', |
| 6564 |
'Samstag'); |
| 6565 |
|
| 6566 |
if ($dow <= 0 || $dow > 7) |
| 6567 |
{ |
| 6568 |
&write_warnings("Invalid day of week number: $dow"); |
| 6569 |
} |
| 6570 |
else |
| 6571 |
{ |
| 6572 |
$DayOfWeek[$dow-1]; |
| 6573 |
} |
| 6574 |
} |
| 6575 |
|
| 6576 |
sub get_day_of_weekname_ngerman{ |
| 6577 |
local($dow) = @_; |
| 6578 |
|
| 6579 |
local(@DayOfWeek) = ('Sonntag', |
| 6580 |
'Montag', |
| 6581 |
'Dienstag', |
| 6582 |
'Mittwoch', |
| 6583 |
'Donnerstag', |
| 6584 |
'Freitag', |
| 6585 |
'Samstag'); |
| 6586 |
|
| 6587 |
if ($dow <= 0 || $dow > 7) |
| 6588 |
{ |
| 6589 |
&write_warnings("Invalid day of week number: $dow"); |
| 6590 |
} |
| 6591 |
else |
| 6592 |
{ |
| 6593 |
$DayOfWeek[$dow-1]; |
| 6594 |
} |
| 6595 |
} |
| 6596 |
|
| 6597 |
sub get_day_of_weekname{ |
| 6598 |
local($dow)=@_; |
| 6599 |
local($dowsub); |
| 6600 |
|
| 6601 |
$dowsub = "get_day_of_weekname_$default_language"; |
| 6602 |
|
| 6603 |
if (defined ($dowsub)) |
| 6604 |
{ |
| 6605 |
&$dowsub($dow); |
| 6606 |
} |
| 6607 |
else |
| 6608 |
{ |
| 6609 |
&get_day_of_weekname_english($dow); |
| 6610 |
} |
| 6611 |
} |
| 6612 |
|
| 6613 |
sub get_short_day_of_weekname_english{ |
| 6614 |
local($dow) = @_; |
| 6615 |
|
| 6616 |
local(@DayOfWeek) = ('Sun', |
| 6617 |
'Mon', |
| 6618 |
'Tue', |
| 6619 |
'Wed', |
| 6620 |
'Thu', |
| 6621 |
'Fri', |
| 6622 |
'Sat'); |
| 6623 |
|
| 6624 |
if ($dow <= 0 || $dow > 7) |
| 6625 |
{ |
| 6626 |
&write_warnings("Invalid day of week number: $dow"); |
| 6627 |
} |
| 6628 |
else |
| 6629 |
{ |
| 6630 |
$DayOfWeek[$dow-1]; |
| 6631 |
} |
| 6632 |
} |
| 6633 |
|
| 6634 |
sub get_short_day_of_weekname_german{ |
| 6635 |
local($dow) = @_; |
| 6636 |
|
| 6637 |
local(@DayOfWeek) = ('So', |
| 6638 |
'Mo', |
| 6639 |
'Di', |
| 6640 |
'Mi', |
| 6641 |
'Do', |
| 6642 |
'Fr', |
| 6643 |
'Sa'); |
| 6644 |
|
| 6645 |
if ($dow <= 0 || $dow > 7) |
| 6646 |
{ |
| 6647 |
&write_warnings("Invalid day of week number: $dow"); |
| 6648 |
} |
| 6649 |
else |
| 6650 |
{ |
| 6651 |
$DayOfWeek[$dow-1]; |
| 6652 |
} |
| 6653 |
} |
| 6654 |
|
| 6655 |
sub get_short_day_of_weekname_ngerman{ |
| 6656 |
local($dow) = @_; |
| 6657 |
|
| 6658 |
local(@DayOfWeek) = ('So', |
| 6659 |
'Mo', |
| 6660 |
'Di', |
| 6661 |
'Mi', |
| 6662 |
'Do', |
| 6663 |
'Fr', |
| 6664 |
'Sa'); |
| 6665 |
|
| 6666 |
if ($dow <= 0 || $dow > 7) |
| 6667 |
{ |
| 6668 |
&write_warnings("Invalid day of week number: $dow"); |
| 6669 |
} |
| 6670 |
else |
| 6671 |
{ |
| 6672 |
$DayOfWeek[$dow-1]; |
| 6673 |
} |
| 6674 |
} |
| 6675 |
|
| 6676 |
sub get_short_day_of_weekname{ |
| 6677 |
local($dow)=@_; |
| 6678 |
local($dowsub); |
| 6679 |
|
| 6680 |
$dowsub = "get_short_day_of_weekname_$default_language"; |
| 6681 |
|
| 6682 |
if (defined ($dowsub)) |
| 6683 |
{ |
| 6684 |
&$dowsub($dow); |
| 6685 |
} |
| 6686 |
else |
| 6687 |
{ |
| 6688 |
substr(&get_day_of_weekname($dow),0,3); |
| 6689 |
} |
| 6690 |
} |
| 6691 |
|
| 6692 |
sub do_cmd_dayofweeknameid{ |
| 6693 |
local($_) = @_; |
| 6694 |
local($dow); |
| 6695 |
|
| 6696 |
$dow = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($dow=$2)); |
| 6697 |
|
| 6698 |
join('',&get_day_of_weekname($dow), $_); |
| 6699 |
} |
| 6700 |
|
| 6701 |
sub do_cmd_dayofweekname{ |
| 6702 |
local($_) = @_; |
| 6703 |
local($day,$month,$year); |
| 6704 |
# read 1st argument |
| 6705 |
$day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2)); |
| 6706 |
# read 2nd argument |
| 6707 |
$month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2)); |
| 6708 |
# read 3rd argument |
| 6709 |
$year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2)); |
| 6710 |
|
| 6711 |
if ($day eq 'THEDAY' or $day eq '\THEDAY') |
| 6712 |
{ |
| 6713 |
# this is a cludge to help newdateformat work |
| 6714 |
|
| 6715 |
join('', '{DOW}', $_); |
| 6716 |
} |
| 6717 |
else |
| 6718 |
{ |
| 6719 |
local($dow) = &get_day_of_week($day,$month,$year); |
| 6720 |
|
| 6721 |
join('',&get_day_of_weekname($dow), $_); |
| 6722 |
} |
| 6723 |
} |
| 6724 |
|
| 6725 |
sub do_cmd_shortdayofweekname{ |
| 6726 |
local($_) = @_; |
| 6727 |
local($day,$month,$year); |
| 6728 |
# read 1st argument |
| 6729 |
$day = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($day=$2)); |
| 6730 |
# read 2nd argument |
| 6731 |
$month = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($month=$2)); |
| 6732 |
# read 3rd argument |
| 6733 |
$year = &missing_braces unless ((s/$next_pair_pr_rx//o)&&($year=$2)); |
| 6734 |
|
| 6735 |
local($dow) = &get_day_of_week($day,$month,$year); |
| 6736 |
|
| 6737 |
join('',&get_short_day_of_weekname($dow), $_); |
| 6738 |
} |
| 6739 |
|
| 6740 |
sub do_cmd_thisdayofweekname{ |
| 6741 |
local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR}); |
| 6742 |
|
| 6743 |
join('',$DayOfWeek[$dow], $_); |
| 6744 |
} |
| 6745 |
|
| 6746 |
sub do_cmd_thisshortdayofweekname{ |
| 6747 |
local($dow) = &get_day_of_week($global{DAY}, $global{MONTH}, $global{YEAR}); |
| 6748 |
|
| 6749 |
join('',&get_short_day_of_weekname($dow), $_); |
| 6750 |
} |
| 6751 |
|
| 6752 |
$dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR"; |
| 6753 |
|
| 6754 |
sub format_date{ |
| 6755 |
local($day,$month,$year) = @_; |
| 6756 |
|
| 6757 |
local($str) = $dateformat; |
| 6758 |
|
| 6759 |
$str =~ s/THEDAY/$day/g; |
| 6760 |
$str =~ s/THEMONTH/$month/g; |
| 6761 |
$str =~ s/THEYEAR/$year/g; |
| 6762 |
|
| 6763 |
$str =~ s/TWODIGIT{([\d]+)}/&get_twodigit($1)/eg; |
| 6764 |
$str =~ s/ROMANNUMERAL{([\d]+)}/&froman($1)/eg; |
| 6765 |
$str =~ s/ROMANNUMERALU{([\d]+)}/uc(&froman($1))/eg; |
| 6766 |
$str =~ s/TRUNCATE{([\d]+)}/&get_twodigit($1%100)/eg; |
| 6767 |
$str =~ s/SHORTMONTHNAME\[([\d]+)\]/&get_shortmonthname($1)/eg; |
| 6768 |
$str =~ s/MONTHNAME\[([\d]+)\]/&get_monthname($1)/eg; |
| 6769 |
|
| 6770 |
local($X) = ++$global{'max_id'}; |
| 6771 |
local($Y) = ++$global{'max_id'}; |
| 6772 |
local($Z) = ++$global{'max_id'}; |
| 6773 |
$str =~ s/{DOW}/\\dayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g; |
| 6774 |
$str =~ s/{SDOW}/\\shortdayofweekname${OP}$X${CP}$day${OP}$X${CP}${OP}$Y${CP}$month${OP}$Y${CP}${OP}$Z${CP}$year${OP}$Z${CP}/g; |
| 6775 |
|
| 6776 |
local($br_id) = ++$global{'max_id'}; |
| 6777 |
$suffix = &get_ordinal_suffix($day); |
| 6778 |
$str =~ s/{ORDINAL{DAY}}/$day\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; |
| 6779 |
|
| 6780 |
$br_id = ++$global{'max_id'}; |
| 6781 |
$suffix = &get_ordinal_suffix($month); |
| 6782 |
$str =~ s/{ORDINAL{MONTH}}/$month\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; |
| 6783 |
|
| 6784 |
$br_id = ++$global{'max_id'}; |
| 6785 |
$suffix = &get_ordinal_suffix($year); |
| 6786 |
$str =~ s/{ORDINAL{YEAR}}/$year\\fmtord${OP}$br_id${CP}$suffix${OP}$br_id${CP}/g; |
| 6787 |
|
| 6788 |
local($br_id) = ++$global{'max_id'}; |
| 6789 |
$str =~ s/{ORDINALDATE{DAY}}/\\ordinaldate${OP}$br_id${CP}$day${OP}$br_id${CP}/g; |
| 6790 |
|
| 6791 |
$str =~ s/{NNUMBERSTRING{DAY}}/&get_Numberstring($day)/eg; |
| 6792 |
$str =~ s/{NNUMBERSTRING{MONTH}}/&get_Numberstring($month)/eg; |
| 6793 |
$str =~ s/{NNUMBERSTRING{YEAR}}/&get_Numberstring($year)/eg; |
| 6794 |
|
| 6795 |
$str =~ s/{OORDINALSTRING{DAY}}/&get_Ordinalstring($day)/eg; |
| 6796 |
$str =~ s/{OORDINALSTRING{MONTH}}/&get_Ordinalstring($month)/eg; |
| 6797 |
$str =~ s/{OORDINALSTRING{YEAR}}/&get_Ordinalstring($year)/eg; |
| 6798 |
|
| 6799 |
$str =~ s/{CAPNUMBERSTRING{DAY}}/uc(&get_numberstring($day))/eg; |
| 6800 |
$str =~ s/{CAPNUMBERSTRING{MONTH}}/uc(&get_numberstring($month))/eg; |
| 6801 |
$str =~ s/{CAPNUMBERSTRING{YEAR}}/uc(&get_numberstring($year))/eg; |
| 6802 |
|
| 6803 |
$str =~ s/{CAPORDINALSTRING{DAY}}/uc(&get_ordinalstring($day))/eg; |
| 6804 |
$str =~ s/{CAPORDINALSTRING{MONTH}}/uc(&get_ordinalstring($month))/eg; |
| 6805 |
$str =~ s/{CAPORDINALSTRING{YEAR}}/uc(&get_ordinalstring($year))/eg; |
| 6806 |
|
| 6807 |
$str =~ s/{NUMBERSTRING{DAY}}/&get_numberstring($day)/eg; |
| 6808 |
$str =~ s/{NUMBERSTRING{MONTH}}/&get_numberstring($month)/eg; |
| 6809 |
$str =~ s/{NUMBERSTRING{YEAR}}/&get_numberstring($year)/eg; |
| 6810 |
|
| 6811 |
$str =~ s/{ORDINALSTRING{DAY}}/&get_ordinalstring($day)/eg; |
| 6812 |
$str =~ s/{ORDINALSTRING{MONTH}}/&get_ordinalstring($month)/eg; |
| 6813 |
$str =~ s/{ORDINALSTRING{YEAR}}/&get_ordinalstring($year)/eg; |
| 6814 |
|
| 6815 |
$str; |
| 6816 |
} |
| 6817 |
|
| 6818 |
sub do_cmd_formatdate{ |
| 6819 |
local($day,$month,$year); |
| 6820 |
# read 1st argument |
| 6821 |
$day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); |
| 6822 |
# read 2nd argument |
| 6823 |
$month = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($month=$2)); |
| 6824 |
# read 3rd argument |
| 6825 |
$year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year=$2)); |
| 6826 |
|
| 6827 |
join('', &format_date($day,$month,$year), $_[0]); |
| 6828 |
} |
| 6829 |
|
| 6830 |
sub do_cmd_today{ |
| 6831 |
join('', &format_date($global{DAY},$global{MONTH},$global{YEAR}), $_[0]); |
| 6832 |
} |
| 6833 |
|
| 6834 |
sub do_cmd_day{ |
| 6835 |
join('', $global{DAY}, $_[0]); |
| 6836 |
} |
| 6837 |
|
| 6838 |
sub do_cmd_month{ |
| 6839 |
join('', $global{MONTH}, $_[0]); |
| 6840 |
} |
| 6841 |
|
| 6842 |
sub do_cmd_year{ |
| 6843 |
join('', $global{YEAR}, $_[0]); |
| 6844 |
} |
| 6845 |
|
| 6846 |
sub do_cmd_showdowtrue{ |
| 6847 |
local($_) = @_; |
| 6848 |
$showdow = 1; |
| 6849 |
$_[0]; |
| 6850 |
} |
| 6851 |
|
| 6852 |
sub do_cmd_showdowfalse{ |
| 6853 |
local($_) = @_; |
| 6854 |
$showdow = 0; |
| 6855 |
$_[0]; |
| 6856 |
} |
| 6857 |
|
| 6858 |
# This is a bit primative, it doesn't allow for |
| 6859 |
# nested conditionals |
| 6860 |
|
| 6861 |
sub do_cmd_ifshowdow{ |
| 6862 |
local($_) = @_; |
| 6863 |
local($ifbit,$elsebit); |
| 6864 |
|
| 6865 |
$_[0] =~s/(.*)\\fi//; |
| 6866 |
|
| 6867 |
$ifbit = $1; |
| 6868 |
|
| 6869 |
$ifbit =~s/(.*)\\else(.*)/\1/g; |
| 6870 |
|
| 6871 |
$elsebit = $2; |
| 6872 |
|
| 6873 |
if ($showdow) |
| 6874 |
{ |
| 6875 |
join('', $ifbit, $_[0]); |
| 6876 |
} |
| 6877 |
else |
| 6878 |
{ |
| 6879 |
join('', $elsebit, $_[0]); |
| 6880 |
} |
| 6881 |
} |
| 6882 |
|
| 6883 |
sub do_cmd_dateseparator{ |
| 6884 |
join('', '/', $_[0]); |
| 6885 |
} |
| 6886 |
|
| 6887 |
sub do_cmd_longdate{ |
| 6888 |
$dateformat = "\\ifshowdow{DOW}\\fi {ORDINALDATE{DAY}}\\ MONTHNAME[THEMONTH], THEYEAR"; |
| 6889 |
|
| 6890 |
$_[0]; |
| 6891 |
} |
| 6892 |
|
| 6893 |
sub do_cmd_shortdate{ |
| 6894 |
$dateformat = "\\ifshowdow{SDOW}\\fi {ORDINALDATE{DAY}}\\ SHORTMONTHNAME[THEMONTH], THEYEAR"; |
| 6895 |
|
| 6896 |
$_[0]; |
| 6897 |
} |
| 6898 |
|
| 6899 |
sub do_cmd_yyyymmdddate{ |
| 6900 |
$dateformat = "THEYEAR\\dateseparator TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}"; |
| 6901 |
|
| 6902 |
$_[0]; |
| 6903 |
} |
| 6904 |
|
| 6905 |
sub do_cmd_ddmmyyyydate{ |
| 6906 |
$dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator THEYEAR"; |
| 6907 |
|
| 6908 |
$_[0]; |
| 6909 |
} |
| 6910 |
|
| 6911 |
sub do_cmd_dmyyyydate{ |
| 6912 |
$dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator THEYEAR"; |
| 6913 |
|
| 6914 |
$_[0]; |
| 6915 |
} |
| 6916 |
|
| 6917 |
sub do_cmd_dmyydate{ |
| 6918 |
$dateformat = "THEDAY\\dateseparator THEMONTH\\dateseparator TRUNCATE{THEYEAR}"; |
| 6919 |
|
| 6920 |
$_[0]; |
| 6921 |
} |
| 6922 |
|
| 6923 |
sub do_cmd_ddmmyydate{ |
| 6924 |
$dateformat = "TWODIGIT{THEDAY}\\dateseparator TWODIGIT{THEMONTH}\\dateseparator TRUNCATE{THEYEAR}"; |
| 6925 |
|
| 6926 |
$_[0]; |
| 6927 |
} |
| 6928 |
|
| 6929 |
sub do_cmd_textdate{ |
| 6930 |
$dateformat = "\\ifshowdow{DOW} the\\fi {OORDINALSTRING{DAY}} of MONTHNAME[THEMONTH], {NNUMBERSTRING{YEAR}}"; |
| 6931 |
|
| 6932 |
$_[0]; |
| 6933 |
} |
| 6934 |
|
| 6935 |
sub do_cmd_usdate{ |
| 6936 |
$dateformat = "MONTHNAME[THEMONTH] THEDAY, THEYEAR"; |
| 6937 |
|
| 6938 |
$_[0]; |
| 6939 |
} |
| 6940 |
|
| 6941 |
sub do_cmd_mmddyyyydate{ |
| 6942 |
$dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator THEYEAR"; |
| 6943 |
|
| 6944 |
$_[0]; |
| 6945 |
} |
| 6946 |
|
| 6947 |
sub do_cmd_mdyyyydate{ |
| 6948 |
$dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator THEYEAR"; |
| 6949 |
|
| 6950 |
$_[0]; |
| 6951 |
} |
| 6952 |
|
| 6953 |
sub do_cmd_mmddyydate{ |
| 6954 |
$dateformat = "TWODIGIT{THEMONTH}\\dateseparator TWODIGIT{THEDAY}\\dateseparator TRUNCATE{THEYEAR}"; |
| 6955 |
|
| 6956 |
$_[0]; |
| 6957 |
} |
| 6958 |
|
| 6959 |
sub do_cmd_mdyydate{ |
| 6960 |
$dateformat = "THEMONTH\\dateseparator THEDAY\\dateseparator TRUNCATE{THEYEAR}"; |
| 6961 |
|
| 6962 |
$_[0]; |
| 6963 |
} |
| 6964 |
|
| 6965 |
sub do_cmd_THEYEAR{ |
| 6966 |
join('', 'THEYEAR', $_[0]); |
| 6967 |
} |
| 6968 |
|
| 6969 |
sub do_cmd_THEMONTH{ |
| 6970 |
join('', 'THEMONTH', $_[0]); |
| 6971 |
} |
| 6972 |
|
| 6973 |
sub do_cmd_THEDAY{ |
| 6974 |
join('', 'THEDAY', $_[0]); |
| 6975 |
} |
| 6976 |
|
| 6977 |
sub do_cmd_newdateformat{ |
| 6978 |
local($_) = @_; |
| 6979 |
local($cmd,$cmdbody); |
| 6980 |
local($ntmp); |
| 6981 |
|
| 6982 |
$cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); |
| 6983 |
$cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2)); |
| 6984 |
|
| 6985 |
$ntmp = 'sub do_cmd_' . $cmd . '{'; |
| 6986 |
$ntmp .= '$dateformat = "' . $cmdbody . '";'; |
| 6987 |
|
| 6988 |
$ntmp .= '$_[0];'; |
| 6989 |
$ntmp .= '}'; |
| 6990 |
|
| 6991 |
eval($ntmp); |
| 6992 |
|
| 6993 |
join('', $_[0]); |
| 6994 |
} |
| 6995 |
|
| 6996 |
sub do_cmd_pdfdate{ |
| 6997 |
local($_) = @_; |
| 6998 |
|
| 6999 |
local($timestring) = sprintf "%d%02d%02d%02d%02d%02d", |
| 7000 |
$global{YEAR}, $global{MONTH}, $global{DAY}, $global{HOUR}, $global{MINUTE}, $global{SECONDS}; |
| 7001 |
|
| 7002 |
join('', $timestring, $_[0]); |
| 7003 |
} |
| 7004 |
|
| 7005 |
%userdates = (); |
| 7006 |
|
| 7007 |
sub do_cmd_newdate{ |
| 7008 |
local($_)=@_; |
| 7009 |
local($datename,$mon,$day,$year); |
| 7010 |
|
| 7011 |
$datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); |
| 7012 |
|
| 7013 |
$day = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); |
| 7014 |
|
| 7015 |
$mon = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($mon =$2)); |
| 7016 |
|
| 7017 |
$year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year =$2)); |
| 7018 |
|
| 7019 |
|
| 7020 |
$userdates{$datename}{day} = $day; |
| 7021 |
$userdates{$datename}{month} = $mon; |
| 7022 |
$userdates{$datename}{year} = $year; |
| 7023 |
|
| 7024 |
join('', $_[0]); |
| 7025 |
} |
| 7026 |
|
| 7027 |
sub do_cmd_displaydate{ |
| 7028 |
local($_)=@_; |
| 7029 |
local($datename); |
| 7030 |
local($cmd,$br_id); |
| 7031 |
|
| 7032 |
$datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); |
| 7033 |
|
| 7034 |
$br_id = ++$global{'max_id'}; |
| 7035 |
$cmd = "$OP$br_id$CP" . $userdates{$datename}{day} ."$OP$br_id$CP"; |
| 7036 |
$br_id = ++$global{'max_id'}; |
| 7037 |
$cmd .= "$OP$br_id$CP" . $userdates{$datename}{month} ."$OP$br_id$CP"; |
| 7038 |
$br_id = ++$global{'max_id'}; |
| 7039 |
$cmd .= "$OP$br_id$CP" . $userdates{$datename}{year} ."$OP$br_id$CP"; |
| 7040 |
|
| 7041 |
join('', '\formatdate', $cmd, $_[0]); |
| 7042 |
} |
| 7043 |
|
| 7044 |
sub do_cmd_getdateyear{ |
| 7045 |
local($_)=@_; |
| 7046 |
local($datename); |
| 7047 |
|
| 7048 |
$datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); |
| 7049 |
|
| 7050 |
join('', $userdates{$datename}{year}, $_[0]); |
| 7051 |
} |
| 7052 |
|
| 7053 |
sub do_cmd_getdatemonth{ |
| 7054 |
local($_)=@_; |
| 7055 |
local($datename); |
| 7056 |
|
| 7057 |
$datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); |
| 7058 |
|
| 7059 |
join('', $userdates{$datename}{month}, $_[0]); |
| 7060 |
} |
| 7061 |
|
| 7062 |
sub do_cmd_getdateday{ |
| 7063 |
local($_)=@_; |
| 7064 |
local($datename); |
| 7065 |
|
| 7066 |
$datename = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($datename=$2)); |
| 7067 |
|
| 7068 |
join('', $userdates{$datename}{day}, $_[0]); |
| 7069 |
} |
| 7070 |
|
| 7071 |
# time commands |
| 7072 |
|
| 7073 |
sub do_cmd_timeseparator{ |
| 7074 |
join('', ':', $_[0]); |
| 7075 |
} |
| 7076 |
|
| 7077 |
sub do_cmd_noon{ |
| 7078 |
local($_) = @_; |
| 7079 |
|
| 7080 |
join('', "Noon", $_[0]); |
| 7081 |
} |
| 7082 |
|
| 7083 |
sub do_cmd_midnight{ |
| 7084 |
local($_) = @_; |
| 7085 |
|
| 7086 |
join('', "Midnight", $_[0]); |
| 7087 |
} |
| 7088 |
|
| 7089 |
sub do_cmd_amname{ |
| 7090 |
local($_) = @_; |
| 7091 |
|
| 7092 |
join('', "am", $_[0]); |
| 7093 |
} |
| 7094 |
|
| 7095 |
sub do_cmd_pmname{ |
| 7096 |
local($_) = @_; |
| 7097 |
|
| 7098 |
join('', "pm", $_[0]); |
| 7099 |
} |
| 7100 |
|
| 7101 |
sub do_cmd_amstring{ |
| 7102 |
local($_) = @_; |
| 7103 |
|
| 7104 |
join('', "in the morning", $_[0]); |
| 7105 |
} |
| 7106 |
|
| 7107 |
sub do_cmd_pmstring{ |
| 7108 |
local($_) = @_; |
| 7109 |
|
| 7110 |
join('', "in the afternoon", $_[0]); |
| 7111 |
} |
| 7112 |
|
| 7113 |
sub do_cmd_halfpast{ |
| 7114 |
local($_) = @_; |
| 7115 |
|
| 7116 |
join('', "Half past", $_[0]); |
| 7117 |
} |
| 7118 |
|
| 7119 |
sub do_cmd_quarterpast{ |
| 7120 |
local($_) = @_; |
| 7121 |
|
| 7122 |
join('', "Quarter past", $_[0]); |
| 7123 |
} |
| 7124 |
|
| 7125 |
sub do_cmd_quarterto{ |
| 7126 |
local($_) = @_; |
| 7127 |
|
| 7128 |
join('', "Quarter to", $_[0]); |
| 7129 |
} |
| 7130 |
|
| 7131 |
sub do_cmd_oclockstring{ |
| 7132 |
local($_) = @_; |
| 7133 |
|
| 7134 |
join('', "O'Clock", $_[0]); |
| 7135 |
} |
| 7136 |
|
| 7137 |
sub do_cmd_amorpmname{ |
| 7138 |
if ($global{HOUR}>12) |
| 7139 |
{ |
| 7140 |
&do_cmd_pmname; |
| 7141 |
} |
| 7142 |
else |
| 7143 |
{ |
| 7144 |
&do_cmd_amname; |
| 7145 |
} |
| 7146 |
} |
| 7147 |
|
| 7148 |
sub do_cmd_amorpmstring{ |
| 7149 |
if ($global{HOUR}>12) |
| 7150 |
{ |
| 7151 |
&do_cmd_pmstring; |
| 7152 |
} |
| 7153 |
else |
| 7154 |
{ |
| 7155 |
&do_cmd_amstring; |
| 7156 |
} |
| 7157 |
} |
| 7158 |
|
| 7159 |
sub set_timeformat_hhmmsstime{ |
| 7160 |
$timeformat = "TWODIGIT{THEHOUR}\\timeseparator TWODIGIT{THEMINUTE}" |
| 7161 |
. "\\timeseparator TWODIGIT{THESECOND}"; |
| 7162 |
} |
| 7163 |
|
| 7164 |
sub set_timeformat_xxivtime{ |
| 7165 |
$timeformat = "TWODIGIT{THEHOUR}\\timeseparator TWODIGIT{THEMINUTE}"; |
| 7166 |
} |
| 7167 |
|
| 7168 |
sub format_xxivtime{ |
| 7169 |
local($hour,$min)=@_; |
| 7170 |
|
| 7171 |
sprintf "%02d\\timeseparator %02d", $hour, $min; |
| 7172 |
} |
| 7173 |
|
| 7174 |
sub do_cmd_xxivtime{ |
| 7175 |
|
| 7176 |
join('', &format_xxivtime($global{HOUR},$global{MINUTE}), $_[0]); |
| 7177 |
} |
| 7178 |
|
| 7179 |
sub format_ampmtime{ |
| 7180 |
local($hour,$min)=@_; |
| 7181 |
local($timestring); |
| 7182 |
local($hourxii) = ($hour == 12 ? 12 : ($hour)%12); |
| 7183 |
|
| 7184 |
$timestring = sprintf "%d\\timeseparator %02d", $hourxii, $min; |
| 7185 |
|
| 7186 |
$timestring .= ($hour < 12 ? |
| 7187 |
"\\amname " : (($hour eq 12 and $min eq 0) ? " \\noon" :"\\pmname ")); |
| 7188 |
|
| 7189 |
$timestring |
| 7190 |
} |
| 7191 |
|
| 7192 |
sub do_cmd_ampmtime{ |
| 7193 |
join('', &format_ampmtime($global{HOUR},$global{MINUTE}), $_[0]); |
| 7194 |
} |
| 7195 |
|
| 7196 |
sub do_cmd_timeformat_at_ampmtime{ |
| 7197 |
local($hour,$min,$sec); |
| 7198 |
# read 1st argument |
| 7199 |
$hour = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); |
| 7200 |
# read 2nd argument |
| 7201 |
$min = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($month=$2)); |
| 7202 |
# read 3rd argument |
| 7203 |
$sec = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year=$2)); |
| 7204 |
|
| 7205 |
join('', &format_ampmtime($hour, $min), $_[0]); |
| 7206 |
} |
| 7207 |
|
| 7208 |
sub do_cmd_timeformatATampmtime{&do_cmd_timeformat_at_ampmtime} |
| 7209 |
|
| 7210 |
sub set_timeformat_ampmtime{ |
| 7211 |
$timeformat = "TWODIGIT{THEHOURXII}\\timeseparator TWODIGIT{THEMINUTE}AMORPMNAME"; |
| 7212 |
} |
| 7213 |
|
| 7214 |
sub format_oclock{ |
| 7215 |
local($hour,$min)=@_; |
| 7216 |
|
| 7217 |
local($hourxii) = ($hour == 12 ? 12 : ($hour)%12); |
| 7218 |
local($tohour) = ($hour == 11 ? 12 :($hour+1)%12); |
| 7219 |
local($tominute) = ($min == 0? 0 : 60 - $min); |
| 7220 |
|
| 7221 |
local($timestring); |
| 7222 |
|
| 7223 |
if ($hour == 0 && $min == 0) |
| 7224 |
{ |
| 7225 |
$timestring = "\\midnight"; |
| 7226 |
} |
| 7227 |
elsif ($hour == 12 && $min == 0) |
| 7228 |
{ |
| 7229 |
$timestring = "\\noon"; |
| 7230 |
} |
| 7231 |
else |
| 7232 |
{ |
| 7233 |
if ($min == 0) |
| 7234 |
{ |
| 7235 |
$timestring = &get_Numberstring($hourxii) . " \\oclockstring"; |
| 7236 |
} |
| 7237 |
elsif ($min == 15) |
| 7238 |
{ |
| 7239 |
$timestring = "\\quarterpast\\ " . &get_Numberstring($hourxii); |
| 7240 |
} |
| 7241 |
elsif ($min == 30) |
| 7242 |
{ |
| 7243 |
$timestring = "\\halfpast\\ " . &get_Numberstring($hourxii); |
| 7244 |
} |
| 7245 |
elsif ($min == 45) |
| 7246 |
{ |
| 7247 |
$timestring = "\\quarterto\\ " . &get_Numberstring($tohour); |
| 7248 |
} |
| 7249 |
elsif ($min < 30) |
| 7250 |
{ |
| 7251 |
$timestring = get_Numberstring($min); |
| 7252 |
|
| 7253 |
$timestring .= ($min == 1 ? " minute" : " minutes") . " past "; |
| 7254 |
|
| 7255 |
$timestring .= get_Numberstring($hourxii); |
| 7256 |
} |
| 7257 |
else |
| 7258 |
{ |
| 7259 |
$timestring = get_Numberstring($tominute); |
| 7260 |
|
| 7261 |
$timestring .= ($min == 1 ? " minute" : " minutes") . " to "; |
| 7262 |
|
| 7263 |
$timestring .= get_Numberstring($tohour); |
| 7264 |
} |
| 7265 |
|
| 7266 |
$timestring .= ($hour < 12 ? " \\amstring" : " \\pmstring"); |
| 7267 |
} |
| 7268 |
|
| 7269 |
$timestring |
| 7270 |
} |
| 7271 |
|
| 7272 |
sub do_cmd_oclock{ |
| 7273 |
local($_) = @_; |
| 7274 |
|
| 7275 |
join('', &format_oclock($global{HOUR},$global{MINUTE}), $_[0]); |
| 7276 |
} |
| 7277 |
|
| 7278 |
sub do_cmd_timeformat_at_oclock{ |
| 7279 |
local($hour,$min,$sec); |
| 7280 |
# read 1st argument |
| 7281 |
$hour = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($day=$2)); |
| 7282 |
# read 2nd argument |
| 7283 |
$min = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($month=$2)); |
| 7284 |
# read 3rd argument |
| 7285 |
$sec = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year=$2)); |
| 7286 |
|
| 7287 |
join('', &format_oclock($hour, $min), $_[0]); |
| 7288 |
} |
| 7289 |
|
| 7290 |
sub do_cmd_timeformatAToclock{&do_cmd_timeformat_at_oclock} |
| 7291 |
|
| 7292 |
sub set_timeformat_oclock{ |
| 7293 |
$timeformat="OCLOCK"; |
| 7294 |
} |
| 7295 |
|
| 7296 |
sub do_cmd_formattime{ |
| 7297 |
local($_) = @_; |
| 7298 |
local($hour,$min,$sec); |
| 7299 |
|
| 7300 |
# read 1st argument |
| 7301 |
$hour = &missing_braces unless |
| 7302 |
(s/$next_pair_pr_rx/$hour=$2;''/eo); |
| 7303 |
# read 2nd argument |
| 7304 |
$min = &missing_braces unless |
| 7305 |
(s/$next_pair_pr_rx/$min=$2;''/eo); |
| 7306 |
# read 3rd argument |
| 7307 |
$sec = &missing_braces unless |
| 7308 |
(s/$next_pair_pr_rx/$sec=$2;''/eo); |
| 7309 |
|
| 7310 |
join('', &format_time($hour,$min,$sec), $_); |
| 7311 |
} |
| 7312 |
|
| 7313 |
sub do_cmd_currenttime{ |
| 7314 |
join('', &format_time($global{HOUR},$global{MINUTE},$global{SECONDS}), $_[0]); |
| 7315 |
} |
| 7316 |
|
| 7317 |
sub format_time{ |
| 7318 |
local($hour,$min,$sec) = @_; |
| 7319 |
|
| 7320 |
local($str) = $timeformat; |
| 7321 |
|
| 7322 |
local($hourxii) = ($hour == 12 ? 12 : ($hour)%12); |
| 7323 |
local($tohour) = ($hour == 11 ? 12 :($hour+1)%12); |
| 7324 |
local($tominute) = ($min == 0? 0 : 60 - $min); |
| 7325 |
local($amorpmname) = ($hour < 12 ? '\amname' : |
| 7326 |
($hour == 12 ? ' \noon' : '\pmname')); |
| 7327 |
|
| 7328 |
$str =~ s/THEHOURXII/$hourxii/g; |
| 7329 |
$str =~ s/THEHOUR/$hour/g; |
| 7330 |
$str =~ s/THEMINUTE/$min/g; |
| 7331 |
$str =~ s/THESECOND/$sec/g; |
| 7332 |
$str =~ s/THETOHOUR/$tohour/g; |
| 7333 |
$str =~ s/THETOMINUTE/$tominute/g; |
| 7334 |
$str =~ s/AMORPMNAME/$amorpmname/g; |
| 7335 |
|
| 7336 |
$str =~ s/TWODIGIT{([\d]+)}/&get_twodigit($1)/eg; |
| 7337 |
$str =~ s/ROMANNUMERAL{([\d]+)}/&froman($1)/eg; |
| 7338 |
$str =~ s/ROMANNUMERALU{([\d]+)}/uc(&froman($1))/eg; |
| 7339 |
|
| 7340 |
$str =~ s/OCLOCK/&format_oclock($hour,$min)/eg; |
| 7341 |
|
| 7342 |
$str; |
| 7343 |
} |
| 7344 |
|
| 7345 |
sub do_cmd_settimeformat{ |
| 7346 |
local($_) = @_; |
| 7347 |
local($cmd); |
| 7348 |
|
| 7349 |
$cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); |
| 7350 |
|
| 7351 |
eval('&set_timeformat_'.$cmd); |
| 7352 |
|
| 7353 |
$_[0]; |
| 7354 |
} |
| 7355 |
|
| 7356 |
sub do_cmd_newtimeformat{ |
| 7357 |
local($_) = @_; |
| 7358 |
local($cmd,$cmdbody); |
| 7359 |
|
| 7360 |
$cmd = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmd=$2)); |
| 7361 |
$cmdbody = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($cmdbody=$2)); |
| 7362 |
|
| 7363 |
$tmp = 'sub do_cmd_'.$cmd.'{&do_cmd_timeformat_at_'.$cmd.';}'; |
| 7364 |
eval($tmp); |
| 7365 |
|
| 7366 |
$tmp = 'sub set_timeformat_'.$cmd.'{'; |
| 7367 |
$tmp .= '$timeformat = "'.$cmdbody .'";'; |
| 7368 |
$tmp .= '}'; |
| 7369 |
eval($tmp); |
| 7370 |
|
| 7371 |
$tmp = 'sub do_cmd_timeformat_at_'.$cmd.'{'; |
| 7372 |
$tmp .= 'local($_)=@_;'; |
| 7373 |
$tmp .= 'local($hour,$min,$sec);'; |
| 7374 |
$tmp .= '$hour=&missing_braces unless '; |
| 7375 |
$tmp .= '((s/$next_pair_pr_rx//o)&&($hour=$2));'; |
| 7376 |
$tmp .= '$min=&missing_braces unless '; |
| 7377 |
$tmp .= '((s/$next_pair_pr_rx//o)&&($min=$2));'; |
| 7378 |
$tmp .= '$sec=&missing_braces unless '; |
| 7379 |
$tmp .= '((s/$next_pair_pr_rx//o)&&($sec=$2));'; |
| 7380 |
$tmp .= '&set_timeformat_'.$cmd.';'; |
| 7381 |
$tmp .= '&format_time($hour, $min, $sec).$_'; |
| 7382 |
$tmp .= "}"; |
| 7383 |
|
| 7384 |
eval($tmp); |
| 7385 |
|
| 7386 |
join('', $_[0]); |
| 7387 |
} |
| 7388 |
|
| 7389 |
sub do_cmd_THEHOUR{ |
| 7390 |
local($_) = @_; |
| 7391 |
|
| 7392 |
join('', $global{HOUR}, $_[0]); |
| 7393 |
} |
| 7394 |
|
| 7395 |
sub do_cmd_THEMINUTE{ |
| 7396 |
local($_) = @_; |
| 7397 |
|
| 7398 |
join('', $global{MINUTE}, $_[0]); |
| 7399 |
} |
| 7400 |
|
| 7401 |
sub do_cmd_THESECOND{ |
| 7402 |
local($_) = @_; |
| 7403 |
|
| 7404 |
join('', $global{SECONDS}, $_[0]); |
| 7405 |
} |
| 7406 |
|
| 7407 |
sub do_cmd_THETOHOUR{ |
| 7408 |
local($_) = @_; |
| 7409 |
|
| 7410 |
join('', $global{TOHOUR}, $_[0]); |
| 7411 |
} |
| 7412 |
|
| 7413 |
sub do_cmd_THETOMINUTE{ |
| 7414 |
local($_) = @_; |
| 7415 |
|
| 7416 |
join('', $global{TOMINUTE}, $_[0]); |
| 7417 |
} |
| 7418 |
|
| 7419 |
sub do_cmd_THEHOURXII{ |
| 7420 |
local($_) = @_; |
| 7421 |
|
| 7422 |
join('', $global{HOURXII}, $_[0]); |
| 7423 |
} |
| 7424 |
|
| 7425 |
1; |
| 7426 |
% \end{macrocode} |
| 7427 |
%\fi |
| 7428 |
%\iffalse |
| 7429 |
% \begin{macrocode} |
| 7430 |
%</datetime.perl> |
| 7431 |
% \end{macrocode} |
| 7432 |
%\fi |
| 7433 |
%\Finale |
| 7434 |
\endinput |