diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/datetime/datetime.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/datetime/datetime.dtx | 1052 |
1 files changed, 728 insertions, 324 deletions
diff --git a/Master/texmf-dist/source/latex/datetime/datetime.dtx b/Master/texmf-dist/source/latex/datetime/datetime.dtx index 0e1d7254c5c..d420ecc299a 100644 --- a/Master/texmf-dist/source/latex/datetime/datetime.dtx +++ b/Master/texmf-dist/source/latex/datetime/datetime.dtx @@ -3,11 +3,11 @@ % Command line args: % -src "(.+)\.(sty)=>\1.\2" % -src "(.+)\.(def)=>\1.\2" -% -doc "manual.tex" +% -doc "datetime-manual.tex" % -author "Nicola Talbot" % -dir "source" % datetime -% Created on 2007/8/20 15:37 +% Created on 2009/11/17 22:04 %\fi %\iffalse %<*package> @@ -30,7 +30,7 @@ %\fi % \iffalse % Doc-Source file to use with LaTeX2e -% Copyright (C) 2007 Nicola Talbot, all rights reserved. +% Copyright (C) 2009 Nicola Talbot, all rights reserved. % \fi % \iffalse %<*driver> @@ -43,7 +43,7 @@ pdftitle={datetime.sty: A Date and Time Package}, pdfkeywords={date,time,LaTeX}]{hyperref} -\CheckSum{4044} + \newcommand{\sty}[1]{\textsf{#1}} \begin{document} @@ -54,7 +54,7 @@ %\RecordChanges %\OnlyDescription % -%\title{datetime.sty v2.55: Formatting Current Date and +%\title{datetime.sty v2.56: Formatting Current Date and %Time} % \author{Nicola L. C. Talbot\\[10pt] % School of Computing Sciences\\ @@ -62,7 +62,7 @@ % Norwich. NR4 7TJ.\\ % United Kingdom.\\ % \url{http://theoval.cmp.uea.ac.uk/~nlct/}} -% \date{20 Aug 2007} +% \date{16th November 2009} % \maketitle % \tableofcontents % \section{Introduction} @@ -100,11 +100,20 @@ %\usepackage{datetime} %\end{verbatim} % -% \section{Date Declarations} +% \section{Predefined Date Formats} % There are various declarations that change the effect of %\cs{today}. The change can be localised by placing the %declaration within a group. % +% +% \vspace{10pt}\noindent ISO format: +% \DescribeMacro{\yyyymmdddate} +% The declaration \verb"\yyyymmdddate" will redefine +%\verb"\today" to produce +% the current date displayed in the form 2000/03/08. (You can +%redefine \cs{dateseparator} to \texttt{-} to change to +%2000-03-08.) +% % \vspace{10pt}\noindent \meta{Day} \meta{Month} \meta{Year} formats:\\ % \noindent\DescribeMacro{\longdate} % The declaration \verb"\longdate" will redefine @@ -189,17 +198,19 @@ %\DescribeMacro{\currenttime} % The current time is displayed using the command %\verb"\currenttime". +% +%\DescribeMacro{\formattime}A specific time can be displayed using +%the command \cs{formattime}\marg{hour}\marg{minute}\marg{second}, where +%\meta{hour} is a number from~0 to~23, and \meta{minute} and +%\meta{second} are numbers from~0 to~59. +% %\DescribeMacro{\settimeformat} % The format can be changed using the declaration %\cs{settimeformat}\marg{style}, where \meta{style} is the name of the -%format\footnote{Note that the commands \cs{xxivtime}, \cs{ampmtime} -%and \cs{oclock} are still available, \cs{settimeformat} redefines -%\cs{currenttime} to the command given by placing a backslash in front -%of \meta{style}. So \cs{settimeformat\{xxivtime\}} sets -%\cs{currenttime} to \cs{xxivtime} and so on.}. Available formats -%are: +%format. Predefined formats are: %\begin{description} %\item[xxivtime] Twenty-four hour time in the form 22:28 (Default) +%\item[hhmmsstime] Twenty-four hour time in the form 22:28:00 %\item[ampmtime] Twelve hour time in the form 10:28pm %\item[oclock] Displays the current time as a string, e.g.\ %Twenty-Eight minutes past Ten in the afternoon. @@ -212,10 +223,11 @@ %\cs{settimeformat}), and \meta{format} is how to format the %time. Within \meta{format} you can use the counters %\texttt{HOUR} (number of hours after midnight), \texttt{MINUTE} -%(number of minutes past the hour), \texttt{HOURXII} (number of +%(number of minutes past the hour), \texttt{SECOND} (number of +%seconds) \texttt{HOURXII} (number of %hours after midnight/midday), \texttt{TOHOUR} (the next hour) and %\texttt{TOMINUTE} (number of minutes to the next hour), and the -%corresponding commands: \cs{THEHOUR}, \cs{THEMINUTE}, +%corresponding commands: \cs{THEHOUR}, \cs{THEMINUTE}, \cs{THESECOND}, %\cs{THEHOURXII}, \cs{THETOHOUR} and \cs{THETOMINUTE}. % %For example, to define a new time format that uses a dot instead of a @@ -257,6 +269,10 @@ % /ModDate (D:\pdfdate) %} %\end{verbatim} +%\textbf{Note} that PDF\TeX\ introduced the new primitive +%\cs{pdfcreationdate} in version 1.30.0, so \cs{pdfdate} isn't +%required with newer versions of PDF\TeX. (\cs{pdfcreationdate} +%is better than \cs{pdfdate} as it also stores the time zone.) % % There are two commands that print the name of the current % month: @@ -454,6 +470,7 @@ % \begin{tabular}{@{\ttfamily}ll} % long & make \cs{today} produce long date\\ % short & make \cs{today} produce short date\\ +% yyyymmdd & make \cs{today} produce YYYY/MM/DD date\\ % ddmmyyyy & make \cs{today} produce DD/MM/YYYY date\\ % dmyyyy & make \cs{today} produce D/M/YYYY date\\ % ddmmyy & make \cs{today} produce DD/MM/YY date\\ @@ -471,6 +488,8 @@ %\cs{shortdate} \\ % & or \cs{textdate}\\ % nodayofweek & don't display the day of week.\\ +% hhmmss & make \cs{currenttime} produce \texttt{hhmmsstime} +%format\\ % 24hr & make \cs{currenttime} produce \texttt{xxivtime} %format\\ % 12hr & make \cs{currenttime} produce \texttt{ampmtime} @@ -479,8 +498,9 @@ %format\\ % nodate & Don't redefine \cs{today} or define the month or %day of week commands\\ -% & (useful if you only want the time commands or -%\verb"\pdfdate") +% & (useful if you only want the time commands) \\ +% iso & as ddmmyyyy and hhmmss but also sets date separator to -\\ +%& and time separator to : % \end{tabular} % %The default options are: \texttt{long}, \texttt{raise}, @@ -488,6 +508,12 @@ % %\section{Multilingual Support} % +%If you use the \sty{ngerman} package, you must use \sty{datetime}'s +%\texttt{ngerman} package option if you want the date displayed +%in the same form as \sty{ngerman}. You must also load \sty{ngerman} +%\emph{before} you load \sty{datetime}. Similarly for the +%\sty{german} package. +% %If you want to use the \sty{babel} package, you must load %it \emph{before} you load the \sty{datetime} package. This %is because the \sty{babel} \cs{date}\meta{lang} commands @@ -504,6 +530,28 @@ %languages that I know, or that other people have been able to supply %for me. % +%As from v2.56, the package options supplied to \sty{datetime} +%override \sty{babel}'s date format. For example: +%\begin{verbatim} +%\usepackage[french,spanish]{babel} +%\usepackage[ddmmyyyy]{datetime} +%\end{verbatim} +%will use ddmmyyyy date format regardless of language. Note that +%if you use a declaration instead of a package option, for +%example: +%\begin{verbatim} +%\usepackage[french,spanish]{babel} +%\usepackage{datetime} +%\ddmmyyyydate +%\end{verbatim} +%the date format will be switched back to \cs{datefrench} or +%\cs{datespanish} whenever the language is set. You can use\par +%\noindent\DescribeMacro{\setdefaultdate}\cs{setdefaultdate}\marg{declaration}\par +%\noindent to always use \marg{declaration} whenever the language +%is set. For example: +%\begin{verbatim} +%\setdefaultdate{\ddmmyyyydate} +%\end{verbatim} % %The commands \cs{monthname} and \cs{shortmonthname}, %will produce the month name in the current language. @@ -526,7 +574,7 @@ %\cs{dayofweeknameid}\meta{lang} and %\cs{shortdayofweeknameid}\meta{lang}. Note that these %commands only take \emph{one} argument which should be -%a number from 1 to 7 indicating the day of the week. +%a number from~1 to~7 indicating the day of the week. % %You can use the following as templates. Replace %\texttt{english} with the name of your language (as given @@ -558,6 +606,14 @@ %If you want them added to future versions of %\sty{datetime}, please email me the code. % +%\section{Registers} +% +%\TeX\ provides \cs{day}, \cs{month}, \cs{year} registers. In +%addition, \sty{datetime} provides the registers: +%\cs{currenthour}, \cs{currentminute} and \cs{currentsecond}. +%Note that old distributions of \TeX\ will always have +%\cs{currentsecond} set to zero. +% %\section{Configuration File} % %As from Version 2.4, the \sty{datetime} package will read in settings @@ -636,13 +692,18 @@ % This section documents the code for \texttt{datetime.sty} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime}[2007/08/20 v2.55 Date Time Package] +\ProvidesPackage{datetime}[2009/11/16 v2.56 Date Time Package] % \end{macrocode} %\texttt{fmtcount.sty} needs to be loaded here as it defines the % command \cs{fmtord} which may be redefined later: % \begin{macrocode} \RequirePackage{fmtcount} % \end{macrocode} +% Need ifthen package for conditional stuff. +% \begin{macrocode} +\RequirePackage{ifthen} +% \end{macrocode} +%\subsubsection{Date Commands} %\begin{macro}{\if@dtl@nodate} % Define a new conditional \cs{if@dt@nodate}. If it is true, % \cs{today} will not be redefined, nor will @@ -682,35 +743,13 @@ % Define the \cs{ordinaldate}\meta{language} macros. These are % needed because some % languages only use an ordinal for the first day of -% the month (such as french). This isn't really needed -% here, but the LaTeX2HTML style file needs \cs{ordinaldate}. +% the month (such as french). %\begin{macro}{\ordinaldateenglish} % English version: % \begin{macrocode} \newcommand*{\ordinaldateenglish}[1]{\ordinalnum{#1}} % \end{macrocode} %\end{macro} -%\begin{macro}{\ordinaldatewelsh} -% Welsh version: -% \begin{macrocode} -\newcommand*{\ordinaldatewelsh}[1]{% -#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ordinaldatebreton} -% Breton version: -% \begin{macrocode} -\newcommand*{\ordinaldatebreton}[1]{% -#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ordinaldatefrench} -% French: -% \begin{macrocode} -\newcommand*{\ordinaldatefrench}[1]{% -#1\ifnum#1=1\ier\fi} -% \end{macrocode} -%\end{macro} %\begin{macro}{\ordinaldate} % If |\ordinaldate|\meta{language} is not defined, then just display % the number. @@ -725,14 +764,6 @@ \fi} % \end{macrocode} %\end{macro} -%\begin{macro}{\ier} -% In case \verb|\ier| hasn't been defined:% -%\changes{v2.47}{27 Oct 2005}{defined if it doesn't -% already exist} -% \begin{macrocode} -\providecommand*{\ier}{\textsuperscript{er}} -% \end{macrocode} -%\end{macro} %\begin{macro}{\ifshowdow} % Now define the declarations that redefine |\formatdate| as they % are used by the package options. Need a conditional to determine @@ -786,6 +817,18 @@ \let\twodigit\two@digits % \end{macrocode} %\end{macro} +%\begin{macro}{\yyyymmdddate} +%\changes{2.56}{2009/11/16}{new} +% Year/month/day format. (Day and month displayed as two digits, +% year displayed as is.) +% \begin{macrocode} +\DeclareRobustCommand*{\yyyymmdddate}{% +\renewcommand*{\formatdate}[3]{% +\@day=##1\relax\@month=##2\relax\@year=##3\relax +\the\@year\dateseparator \twodigit\@month\dateseparator +\twodigit\@day}} +% \end{macrocode} +%\end{macro} %\begin{macro}{\ddmmyyyydate} % Day/month/year format. (Day and month displayed as two digits, % year displayed as is.) @@ -942,11 +985,70 @@ \csname date@#1@y\endcsname}}} % \end{macrocode} %\end{macro} +% Set defaults: +% \begin{macrocode} +\longdate +\showdowtrue +% \end{macrocode} +% +%\changes{2.56}{2009/11/16}{moved definition of \cs{newdateformat} +% before cfg file loaded} +% Define |\newdateformat| which defines a declaration that redefines |\formatdate| so that +% it uses |\dateformat|. |\dateformat| takes four arguments, the first defines the format +% the last three arguments are the three arguments that effectively get passed to |\formatdate|. +% |\dateformat| sets |\@day|, |\@month| and |\@year|. |\c@DAY|, |\c@MONTH| and |\c@YEAR| +% are set as synonims for |\@day|, |\@month| and |\@year|, to that the uses can use the counters +% |DAY|, |MONTH| and |YEAR| as part of the format. +% The commands |\THEDAY|, |\THEMONTH| and |\THEYEAR| should only be +% used in the argument to |\newdateformat|. This is done partly to +% assist the \LaTeX2HTML version. +% +% This command must be defined before the configuration file is +% loaded, which in turn must be before the package options, therefore +% can't test for \texttt{nodate} package option. +% \begin{macrocode} +\providecommand*\THEDAY{\the\@day} +\providecommand*\THEMONTH{\the\@month} +\providecommand*\THEYEAR{\the\@year} +% \end{macrocode} +% Simulate a \LaTeX\ counter. +% \begin{macrocode} +\let\c@DAY=\@day +\let\c@MONTH=\@month +\let\c@YEAR=\@year +% \end{macrocode} +%\begin{macro}{\newdateformat} +% Provide a means to define a new date format. +%\changes{2.2}{2004/04/27}{new} +% \begin{macrocode} +\providecommand{\newdateformat}[2]{% +\@ifundefined{#1}{% +\expandafter\DeclareRobustCommand\csname#1\endcsname{% +\renewcommand{\formatdate}{\dateformat{#2}}}}{% +\PackageError{datetime}{Can't create new date format, command +\textbackslash#1 already defined}{You will need to +give your new date format a different name}}} +% \end{macrocode} +%\end{macro} +% \subsubsection{Time Macros} %\begin{macro}{\currenttime} % (New to v2.3) Define |\currenttime| which will print the -% time according to the current format. Set it to 24hr time by default +% time according to the current format. +%\changes{2.56}{2009/11/16}{change to use \cs{formattime}} % \begin{macrocode} -\DeclareRobustCommand*{\currenttime}{\xxivtime} +\DeclareRobustCommand*{\currenttime}{% + \formattime{\currenthour}{\currentminute}{\currentsecond}% +} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\formattime} +% Define \cs{formattime} analoguous to \cs{formatdate}. +% Set it to 24hr time by default +%\changes{2.56}{2009/11/16}{new} +% \begin{macrocode} +\newcommand*{\formattime}[3]{\protect\@formattime{#1}{#2}{#3}} +\newcommand*{\@formattime}[3]{% + \csname timeformat@xxivtime\endcsname{#1}{#2}{#3}} % \end{macrocode} %\end{macro} %\begin{macro}{\timeseparator} @@ -959,16 +1061,252 @@ %\begin{macro}{\settimeformat} % Switch to specified time format: %\changes{2.3}{2004/05/01}{new} +%\changes{2.56}{2009/11/16}{now sets formattime} % \begin{macrocode} \providecommand*{\settimeformat}[1]{% -\DeclareRobustCommand*\currenttime{\csname#1\endcsname}} + \@ifundefined{timeformat@#1}{% + \PackageError{datetime}{Unknown time format `#1'}{}% + }{% + \renewcommand*{\@formattime}[3]{% + \csname timeformat@#1\endcsname{##1}{##2}{##3}}% + }% +} % \end{macrocode} %\end{macro} -% Set defaults: +% Define a command to create a new time format, similar to the new +% date format. Again this is done in a way that makes it easier to +% code the \LaTeX2HTML version. % \begin{macrocode} -\longdate -\showdowtrue +\newcount\c@HOUR +\newcount\c@HOURXII +\newcount\c@MINUTE +\newcount\c@TOHOUR +\newcount\c@TOMINUTE +\newcount\c@SECOND +% \end{macrocode} +% These commands should only be used in |\newtimeformat|. +% \begin{macrocode} +\def\THEHOUR{\the\c@HOUR} +\def\THEHOURXII{\the\c@HOURXII} +\def\THEMINUTE{\the\c@MINUTE} +\def\THETOHOUR{\the\c@TOHOUR} +\def\THETOMINUTE{\the\c@TOMINUTE} +\def\THESECOND{\the\c@SECOND} +% \end{macrocode} +%\begin{macro}{\currenthour} +%\changes{2.56}{2009/11/16}{new} +% Store the current hour +% \begin{macrocode} +\newcount\currenthour +% \end{macrocode} +%\end{macro} +%\begin{macro}{\currentminute} +%\changes{2.56}{2009/11/16}{new} +% Store current minute +% \begin{macrocode} +\newcount\currentminute +% \end{macrocode} +%\end{macro} +%\begin{macro}{\currentsecond} +%\changes{2.56}{2009/11/16}{new} +\newcount\currentsecond +%\end{macro} +% Get time information from \cs{pdfcreationdate} (if it exists) +% \begin{macrocode} +{\catcode`\D=12\relax + \gdef\@dt@getdate D:#1#2#3#4#5#6#7#8{\@dt@gettime}% +} +\@ifundefined{pdfcreationdate}{% + \currenthour=\time\relax + \divide\currenthour by 60\relax + \currentminute=\time\relax + \@modulo{\currentminute}{60}% + \currentsecond=0\relax +}{% + \def\@dt@gettime#1#2#3#4#5#6#7\relax{% + \currenthour=#1#2\relax + \currentminute=#3#4\relax + \currentsecond=#5#6\relax}% + \expandafter\@dt@getdate\pdfcreationdate\relax +} +% \end{macrocode} +%\begin{macro}{\newtimeformat} +% Provide a means to define a new time format. +%\changes{2.3}{2004/05/01}{new} +%\changes{2.56}{2009/11/16}{added \cs{timeformat}@\meta{name}} +% \begin{macrocode} +\providecommand*{\newtimeformat}[2]{% +\@ifundefined{#1}{% +\expandafter\def\csname#1\endcsname{% + \csname timeformat@#1\endcsname{\currenthour}{\currentminute}% + {\currentsecond}% +}% +\expandafter\def\csname timeformat@#1\endcsname##1##2##3{% +\c@HOUR=##1% +\c@HOURXII=\c@HOUR +\ifnum\c@HOURXII>12 +\advance\c@HOURXII by -12\relax +\fi +\c@MINUTE=##2% +\c@TOHOUR=\c@HOURXII +\advance\c@TOHOUR by 1\relax +\@modulo{\c@TOHOUR}{12}% +\c@TOMINUTE=\c@MINUTE +\advance\c@TOMINUTE by -60\relax +\multiply\c@TOMINUTE by -1\relax +\c@SECOND=##3\relax +#2\relax +}}{% +\PackageError{datetime}{Command \textbackslash#1 already defined}{% +You can't create a new time format called "#1" as the command +\textbackslash#1 already exists}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\xxivtime} +% Define commands to print the current time. Twenty-four hour time: +% \begin{macrocode} +\newtimeformat{xxivtime}{% +\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\hhmmsstime} +% Twenty-four hour time including seconds. +% \begin{macrocode} +\newtimeformat{hhmmsstime}{% +\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE\timeseparator +\twodigit\THESECOND} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ampmtime} +% 12-hour time: +%\changes{2.3}{2004/05/01}{fixed minor bug} +%\changes{2.51}{2007/01/30}{fixed bug between midnight and 1am} +% \begin{macrocode} +\newtimeformat{ampmtime}{% +\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator +\twodigit\THEMINUTE +\ifthenelse{\value{HOUR}<12}{\amname}{% +\ifthenelse{\value{HOUR}=12}{ \noon}{\pmname}}} +% \end{macrocode} +%\end{macro} +% Textual time: +%\begin{macro}{\hourstring} +% \cs{hourstring}\marg{count} will print |\midnight| if +% \meta{count} is 0, otherwise will do \cs{Numberstring}\marg{count}. +% \begin{macrocode} +\newcommand*{\hourstring}[1]{% +\ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\oclock} +%\changes{2.43}{2005/02/23}{fixed bug causing an infinite loop on the hour} +% \begin{macrocode} +\newtimeformat{oclock}{% + \ifthenelse{\(\value{HOUR}=0 \OR \value{HOUR}=12 \OR\value{HOUR}=24\)\AND + \value{MINUTE}=0}{% +% \end{macrocode} +% Midnight or Midday: +% \begin{macrocode} +\ifthenelse{\value{HOUR}=12}{\noon}{\midnight}}{% % \end{macrocode} +% Neither Midnight nor Midday. +% Do minutes first +% \begin{macrocode} +\ifthenelse{\value{MINUTE}=0}{% +% \end{macrocode} +% On the hour: don't print any minutes, just do the hour and +% |\oclockstring| +% \begin{macrocode} +\Numberstring{HOUR} \oclockstring}{% +\ifthenelse{\value{MINUTE}=15}{% +\quarterpast\ \hourstring{HOUR}}{% +\ifthenelse{\value{MINUTE}=30}{% +\halfpast\ \hourstring{HOUR}}{% +\ifthenelse{\value{MINUTE}=45}{% +\quarterto\ \hourstring{TOHOUR}}{% +\ifthenelse{\value{MINUTE}<30}{% +\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} +past \hourstring{HOURXII}}{% +\Numberstring{TOMINUTE}\ \ifthenelse{% +\value{TOMINUTE}=1}{minute}{minutes} to \hourstring{TOHOUR}}}}}}% +% \end{macrocode} +% Now say whether it is morning or afternoon +% \begin{macrocode} +\ifthenelse{\value{HOUR}<12}{% +% \end{macrocode} +% Morning +% \begin{macrocode} +\ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% +% \end{macrocode} +% Afternoon +% \begin{macrocode} +\ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} +% \end{macrocode} +%\end{macro} +% Define textual strings used in the above. +%\begin{macro}{\amname} +% \begin{macrocode} +\providecommand*{\amname}{am} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\pmname} +% \begin{macrocode} +\providecommand*{\pmname}{pm} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amorpmname} +% \begin{macrocode} +\providecommand*{\amorpmname}{% +\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amstring} +% \begin{macrocode} +\providecommand*{\amstring}{in the morning} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\pmstring} +% \begin{macrocode} +\providecommand*{\pmstring}{in the afternoon} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\amorpmstring} +% \begin{macrocode} +\providecommand*{\amorpmstring}{% +\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\halfpast} +% \begin{macrocode} +\providecommand*{\halfpast}{Half past} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\quarterpast} +% \begin{macrocode} +\providecommand*{\quarterpast}{Quarter past} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\quarterto} +% \begin{macrocode} +\providecommand*{\quarterto}{Quarter to} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\noon} +% \begin{macrocode} +\providecommand*{\noon}{Noon} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\midnight} +% \begin{macrocode} +\providecommand*{\midnight}{Midnight} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\oclockstring} +% \begin{macrocode} +\providecommand*{\oclockstring}{O'Clock} +% \end{macrocode} +%\end{macro} +%\subsubsection{Configuration File} % Load in specifications from configuration file: %\changes{2.4}{2004/09/25}{added provision for configuration file %datetime.cfg} @@ -978,37 +1316,198 @@ Loading local datetime configurations}}{% \PackageInfo{datetime}{No datetime.cfg file found, using default settings}} % \end{macrocode} +%\subsubsection{Package Options} +% Package options need to override \sty{babel}, so define command to +% add date format to \sty{babel}'s extras. +% \begin{macrocode} +\@ifpackageloaded{babel}{% + \newcommand*{\dt@addtoextras}[1]{% + \@ifundefined{extrasenglish}{}{% + \addto\extrasenglish{#1}% + }% + \@ifundefined{extrasamerican}{}{% + \addto\extrasamerican{#1}% + }% + \@ifundefined{extrasaustrian}{}{% + \addto\extrasaustrian{#1}% + }% + \@ifundefined{extrasbahasa}{}{% + \addto\extrasbahasa{#1}% + }% + \@ifundefined{extrasbreton}{}{% + \addto\extrasbreton{#1}% + }% + \@ifundefined{extrasbritish}{}{% + \addto\extrasbritish{#1}% + }% + \@ifundefined{extrasbulgarian}{}{% + \addto\extrasbulgarian{#1}% + }% + \@ifundefined{extrascatalan}{}{% + \addto\extrascatalan{#1}% + }% + \@ifundefined{extrascroatian}{}{% + \addto\extrascroatian{#1}% + }% + \@ifundefined{extrasczech}{}{% + \addto\extrasczech{#1}% + }% + \@ifundefined{extrasdanish}{}{% + \addto\extrasdanish{#1}% + }% + \@ifundefined{extrasesperanto}{}{% + \addto\extrasesperanto{#1}% + }% + \@ifundefined{extrasestonian}{}{% + \addto\extrasestonian{#1}% + }% + \@ifundefined{extrasfinnish}{}{% + \addto\extrasfinnish{#1}% + }% + \@ifundefined{extrasfrench}{}{% + \addto\extrasfrench{#1}% + }% + \@ifundefined{extrasgalician}{}{% + \addto\extrasgalician{#1}% + }% + \@ifundefined{extrasgerman}{}{% + \addto\extrasgerman{#1}% + }% + \@ifundefined{extrasgreek}{}{% + \addto\extrasgreek{#1}% + }% + \@ifundefined{extrashebrew}{}{% + \addto\extrashebrew{#1}% + }% + \@ifundefined{extrasicelandic}{}{% + \addto\extrasicelandic{#1}% + }% + \@ifundefined{extrasirish}{}{% + \addto\extrasirish{#1}% + }% + \@ifundefined{extrasitalian}{}{% + \addto\extrasitalian{#1}% + }% + \@ifundefined{extraslatin}{}{% + \addto\extraslatin{#1}% + }% + \@ifundefined{extraslsorbian}{}{% + \addto\extraslsorbian{#1}% + }% + \@ifundefined{extrasmagyar}{}{% + \addto\extrasmagyar{#1}% + }% + \@ifundefined{extrasnaustrian}{}{% + \addto\extrasnaustrian{#1}% + }% + \@ifundefined{extrasngerman}{}{% + \addto\extrasngerman{#1}% + }% + \@ifundefined{extrasnorsk}{}{% + \addto\extrasnorsk{#1}% + }% + \@ifundefined{extraspolish}{}{% + \addto\extraspolish{#1}% + }% + \@ifundefined{extrasportuges}{}{% + \addto\extrasportuges{#1}% + }% + \@ifundefined{extrasromanian}{}{% + \addto\extrasromanian{#1}% + }% + \@ifundefined{extrasrussian}{}{% + \addto\extrasrussian{#1}% + }% + \@ifundefined{extrassamin}{}{% + \addto\extrassamin{#1}% + }% + \@ifundefined{extrasscottish}{}{% + \addto\extrasscottish{#1}% + }% + \@ifundefined{extrasserbian}{}{% + \addto\extrasserbian{#1}% + }% + \@ifundefined{extrasslovak}{}{% + \addto\extrasslovak{#1}% + }% + \@ifundefined{extrasslovene}{}{% + \addto\extrasslovene{#1}% + }% + \@ifundefined{extrasspanish}{}{% + \addto\extrasspanish{#1}% + }% + \@ifundefined{extrasswedish}{}{% + \addto\extrasswedish{#1}% + }% + \@ifundefined{extrasturkish}{}{% + \addto\extrasturkish{#1}% + }% + \@ifundefined{extrasUKenglish}{}{% + \addto\extrasUKenglish{#1}% + }% + \@ifundefined{extrasukraine}{}{% + \addto\extrasukraine{#1}% + }% + \@ifundefined{extrasUSenglish}{}{% + \addto\extrasUSenglish{#1}% + }% + \@ifundefined{extrasusorbian}{}{% + \addto\extrasusorbian{#1}% + }% + \@ifundefined{extraswelsh}{}{% + \addto\extraswelsh{#1}% + }% + } +}{% + \newcommand*{\dt@addtoextras}[1]{} +} +% \end{macrocode} +%\begin{macro}{setdefaultdate} +% Set default date. +% \begin{macrocode} +\newcommand*{\setdefaultdate}[1]{\dt@addtoextras{#1}#1} +% \end{macrocode} +%\end{macro} % Specify the package options, specify default options and process % \begin{macrocode} \RequirePackage{fmtcount} -\DeclareOption{long}{\longdate} -\DeclareOption{short}{\shortdate} -\DeclareOption{ddmmyyyy}{\ddmmyyyydate} -\DeclareOption{dmyyyy}{\dmyyyydate} -\DeclareOption{ddmmyy}{\ddmmyydate} -\DeclareOption{dmyy}{\dmyydate} -\DeclareOption{text}{\textdate} -\DeclareOption{us}{\usdate} -\DeclareOption{mmddyyyy}{\mmddyyyydate} -\DeclareOption{mdyyyy}{\mdyyyydate} -\DeclareOption{mmddyy}{\mmddyydate} -\DeclareOption{mdyy}{\mdyydate} +\DeclareOption{long}{\setdefaultdate{\longdate}} +\DeclareOption{short}{\setdefaultdate{\shortdate}} +\DeclareOption{yyyymmdd}{\setdefaultdate{\yyyymmdddate}} +\DeclareOption{ddmmyyyy}{\setdefaultdate{\ddmmyyyydate}} +\DeclareOption{dmyyyy}{\setdefaultdate{\dmyyyydate}} +\DeclareOption{ddmmyy}{\setdefaultdate{\ddmmyydate}} +\DeclareOption{dmyy}{\setdefaultdate{\dmyydate}} +\DeclareOption{text}{\setdefaultdate{\textdate}} +\DeclareOption{us}{\setdefaultdate{\usdate}} +\DeclareOption{mmddyyyy}{\setdefaultdate{\mmddyyyydate}} +\DeclareOption{mdyyyy}{\setdefaultdate{\mdyyyydate}} +\DeclareOption{mmddyy}{\setdefaultdate{\mmddyydate}} +\DeclareOption{mdyy}{\setdefaultdate{\mdyydate}} \DeclareOption{level}{\fmtcountsetoptions{fmtord=level}} \DeclareOption{raise}{\fmtcountsetoptions{fmtord=raise}} \DeclareOption{dayofweek}{\showdowtrue} \DeclareOption{nodayofweek}{\showdowfalse} \DeclareOption{nodate}{\@dt@nodatetrue} +\DeclareOption{hhmmss}{\settimeformat{hhmmsstime}} \DeclareOption{24hr}{\settimeformat{xxivtime}} \DeclareOption{12hr}{\settimeformat{ampmtime}} \DeclareOption{oclock}{\settimeformat{oclock}} +\DeclareOption{iso}{% + \setdefaultdate{\yyyymmdddate}\settimeformat{hhmmsstime}% + \renewcommand*{\dateseparator}{-}% + \renewcommand*{\timeseparator}{:}% +} % \end{macrocode} % Multilingual support. These package options shouldn't really be % needed if babel has already been loaded. % \begin{macrocode} \DeclareOption{austrian}{\input{dt-austrian.def}} +\DeclareOption{american}{\input{dt-american.def}} \DeclareOption{bahasa}{\input{dt-bahasa.def}} \DeclareOption{basque}{\input{dt-basque.def}} \DeclareOption{breton}{\input{dt-breton.def}} +\DeclareOption{british}{\input{dt-british.def}} \DeclareOption{bulgarian}{\input{dt-bulgarian.def}} \DeclareOption{catalan}{\input{dt-catalan.def}} \DeclareOption{croatian}{\input{dt-croatian.def}} @@ -1020,7 +1519,7 @@ settings}} \DeclareOption{finnish}{\input{dt-finnish.def}} \DeclareOption{french}{\input{dt-french.def}} \DeclareOption{galician}{\input{dt-galician.def}} -\DeclareOption{german}{\input{dt-german.def}} +\DeclareOption{german}{\input{dt-german.def}\dategerman} \DeclareOption{greek}{\input{dt-greek.def}} \DeclareOption{hebrew}{\input{dt-hebrew.def}} \DeclareOption{icelandic}{\input{dt-icelandic.def}} @@ -1030,7 +1529,7 @@ settings}} \DeclareOption{lsorbian}{\input{dt-lsorbian.def}} \DeclareOption{magyar}{\input{dt-magyar.def}} \DeclareOption{naustrian}{\input{dt-naustrian.def}} -\DeclareOption{ngerman}{\input{dt-ngerman.def}} +\DeclareOption{ngerman}{\input{dt-ngerman.def}\datengerman} \DeclareOption{norsk}{\input{dt-norsk.def}} \DeclareOption{polish}{\input{dt-polish.def}} \DeclareOption{portuges}{\input{dt-portuges.def}} @@ -1046,17 +1545,31 @@ settings}} \DeclareOption{turkish}{\input{dt-turkish.def}} \DeclareOption{ukraineb}{\input{dt-ukraineb.def}} \DeclareOption{usorbian}{\input{dt-usorbian.def}} +\DeclareOption{UKenglish}{\input{dt-UKenglish.def}} +\DeclareOption{USenglish}{\input{dt-USenglish.def}} \DeclareOption{welsh}{\input{dt-welsh.def}} % \end{macrocode} % Process package options % \begin{macrocode} \ProcessOptions % \end{macrocode} -% Need ifthen package for conditional stuff. +% \subsubsection{Date Specific Macros} % \begin{macrocode} -\RequirePackage{ifthen} +\if@dt@nodate + \PackageInfo{datetime}{option "nodate" used, so note defining +\string\dateformat} +\else +% \end{macrocode} +%\begin{macro}{\dateformat} +% Format the given date in the given format. +% \begin{macrocode} +\providecommand*{\dateformat}[4]{% +\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} +% \end{macrocode} +%\end{macro} +% \begin{macrocode} +\fi % \end{macrocode} -% \subsubsection{Date Macros} % Define the macro that prints the month name. % (Only define this command if @dt@nodate is false) % \begin{macrocode} @@ -1401,6 +1914,7 @@ language '\languagename', defaulting to long version}}% \@ifundefined{dateUKenglish}{}{\input{dt-UKenglish.def}} \@ifundefined{dateUSenglish}{}{\input{dt-USenglish.def}} \@ifundefined{datebritish}{}{\input{dt-british.def}} +\@ifundefined{dateamerican}{}{\input{dt-american.def}} \@ifundefined{dateaustrian}{}{\input{dt-austrian.def}} \@ifundefined{datebahasa}{}{\input{dt-bahasa.def}} \@ifundefined{datebasque}{}{\input{dt-basque.def}} @@ -1446,243 +1960,12 @@ language '\languagename', defaulting to long version}}% \fi % \end{macrocode} % -% Define |\newdateformat| which defines a declaration that redefines |\formatdate| so that -% it uses |\dateformat|. |\dateformat| takes four arguments, the first defines the format -% the last three arguments are the three arguments that effectively get passed to |\formatdate|. -% |\dateformat| sets |\@day|, |\@month| and |\@year|. |\c@DAY|, |\c@MONTH| and |\c@YEAR| -% are set as synonims for |\@day|, |\@month| and |\@year|, to that the uses can use the counters -% |DAY|, |MONTH| and |YEAR| as part of the format. -% \begin{macrocode} -\if@dt@nodate -\PackageInfo{datetime}{option "nodate" used, so not -defining \string\newdateformat} -\else -% \end{macrocode} -% The commands |\THEDAY|, |\THEMONTH| and |\THEYEAR| should only be -% used in the argument to |\newdateformat|. This is done partly to -% assist the \LaTeX2HTML version. -% \begin{macrocode} -\providecommand*\THEDAY{\the\@day} -\providecommand*\THEMONTH{\the\@month} -\providecommand*\THEYEAR{\the\@year} -% \end{macrocode} -% Simulate a \LaTeX\ counter. -% \begin{macrocode} -\let\c@DAY=\@day -\let\c@MONTH=\@month -\let\c@YEAR=\@year -% \end{macrocode} -%\begin{macro}{\dateformat} -% Format the given date in the given format. -% \begin{macrocode} -\providecommand*{\dateformat}[4]{% -\@day=#2\relax\@month=#3\relax\@year=#4\relax#1} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\newdateformat} -% Provide a means to define a new date format. -%\changes{2.2}{2004/04/27}{new} -% \begin{macrocode} -\providecommand{\newdateformat}[2]{% -\@ifundefined{#1}{% -\expandafter\DeclareRobustCommand\csname#1\endcsname{% -\renewcommand{\formatdate}{\dateformat{#2}}}}{% -\PackageError{datetime}{Can't create new date format, command -\textbackslash#1 already defined}{You will need to -give your new date format a different name}}} -% \end{macrocode} -%\end{macro} -% End of |\if@no@date| else part: -% \begin{macrocode} -\fi -% \end{macrocode} -% -% \subsubsection{Time Macros} -% Define a command to create a new time format, similar to the new -% date format. Again this is done in a way that makes it easier to -% code the \LaTeX2HTML version. -% \begin{macrocode} -\newcount\c@HOUR -\newcount\c@HOURXII -\newcount\c@MINUTE -\newcount\c@TOHOUR -\newcount\c@TOMINUTE -% \end{macrocode} -% These commands should only be used in |\newtimeformat|. -% \begin{macrocode} -\def\THEHOUR{\the\c@HOUR} -\def\THEHOURXII{\the\c@HOURXII} -\def\THEMINUTE{\the\c@MINUTE} -\def\THETOHOUR{\the\c@TOHOUR} -\def\THETOMINUTE{\the\c@TOMINUTE} -% \end{macrocode} -%\begin{macro}{\newtimeformat} -% Provide a means to define a new time format. -%\changes{2.3}{2004/05/01}{new} -% \begin{macrocode} -\providecommand*{\newtimeformat}[2]{% -\@ifundefined{#1}{% -\expandafter\def\csname#1\endcsname{% -\c@HOUR=\time% -\divide\c@HOUR by 60\relax -\c@HOURXII=\c@HOUR -\ifnum\c@HOURXII>12 -\advance\c@HOURXII by -12\relax -\fi -\c@MINUTE=\time% -\@modulo{\c@MINUTE}{60}% -\c@TOHOUR=\c@HOURXII -\advance\c@TOHOUR by 1\relax -\@modulo{\c@TOHOUR}{12}% -\c@TOMINUTE=\c@MINUTE -\advance\c@TOMINUTE by -60\relax -\multiply\c@TOMINUTE by -1\relax -#2\relax -}}{% -\PackageError{datetime}{Command \textbackslash#1 already defined}{% -You can't create a new time format called "#1" as the command -\textbackslash#1 already exists}}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\xxivtime} -% Define commands to print the current time. Twenty-four hour time: -% \begin{macrocode} -\newtimeformat{xxivtime}{% -\twodigit\THEHOUR\timeseparator\twodigit\THEMINUTE} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\ampmtime} -% 12-hour time: -%\changes{2.3}{2004/05/01}{fixed minor bug} -%\changes{2.51}{2007/01/30}{fixed bug between midnight and 1am} -% \begin{macrocode} -\newtimeformat{ampmtime}{% -\ifthenelse{\value{HOUR}=0}{12}{\THEHOURXII}\timeseparator -\twodigit\THEMINUTE -\ifthenelse{\value{HOUR}<12}{\amname}{% -\ifthenelse{\time=720}{ \noon}{\pmname}}} -% \end{macrocode} -%\end{macro} -% Textual time: -%\begin{macro}{\hourstring} -% \cs{hourstring}\marg{count} will print |\midnight| if -% \meta{count} is 0, otherwise will do \cs{Numberstring}\marg{count}. -% \begin{macrocode} -\newcommand*{\hourstring}[1]{% -\ifthenelse{\value{#1}=0}{\midnight}{\Numberstring{#1}}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\oclock} -%\changes{2.43}{2005/02/23}{fixed bug causing an infinite loop on the hour} -% \begin{macrocode} -\newtimeformat{oclock}{\ifthenelse{\time=0 \or \time=720}{% -% \end{macrocode} -% Midnight or Midday: -% \begin{macrocode} -\ifthenelse{\time=0}{\midnight}{\noon}}{% -% \end{macrocode} -% Neither Midnight nor Midday. -% Do minutes first -% \begin{macrocode} -\ifthenelse{\value{MINUTE}=0}{% -% \end{macrocode} -% On the hour: don't print any minutes, just do the hour and -% |\oclockstring| -% \begin{macrocode} -\Numberstring{HOUR} \oclockstring}{% -\ifthenelse{\value{MINUTE}=15}{% -\quarterpast\ \hourstring{HOUR}}{% -\ifthenelse{\value{MINUTE}=30}{% -\halfpast\ \hourstring{HOUR}}{% -\ifthenelse{\value{MINUTE}=45}{% -\quarterto\ \hourstring{TOHOUR}}{% -\ifthenelse{\value{MINUTE}<30}{% -\Numberstring{MINUTE}\ \ifthenelse{\value{MINUTE}=1}{minute}{minutes} -past \hourstring{HOURXII}}{% -\Numberstring{TOMINUTE}\ \ifthenelse{% -\value{TOMINUTE}=1}{minute}{minutes} to \hourstring{TOHOUR}}}}}}% -% \end{macrocode} -% Now say whether it is morning or afternoon -% \begin{macrocode} -\ifthenelse{\value{HOUR}<12}{% -% \end{macrocode} -% Morning -% \begin{macrocode} -\ifthenelse{\value{HOUR}=0}{}{\ \amstring}}{% -% \end{macrocode} -% Afternoon -% \begin{macrocode} -\ifthenelse{\value{TOHOUR}=0}{}{\ \pmstring}}}} -% \end{macrocode} -%\end{macro} -% Define textual strings used in the above. -%\begin{macro}{\amname} -% \begin{macrocode} -\providecommand*{\amname}{am} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\pmname} -% \begin{macrocode} -\providecommand*{\pmname}{pm} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\amorpmname} -% \begin{macrocode} -\providecommand*{\amorpmname}{% -\ifthenelse{\value{HOUR}>12}{\pmname}{\amname}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\amstring} -% \begin{macrocode} -\providecommand*{\amstring}{in the morning} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\pmstring} -% \begin{macrocode} -\providecommand*{\pmstring}{in the afternoon} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\amorpmstring} -% \begin{macrocode} -\providecommand*{\amorpmstring}{% -\ifthenelse{\value{HOUR}>12}{\pmstring}{\amstring}} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\halfpast} -% \begin{macrocode} -\providecommand*{\halfpast}{Half past} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\quarterpast} -% \begin{macrocode} -\providecommand*{\quarterpast}{Quarter past} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\quarterto} -% \begin{macrocode} -\providecommand*{\quarterto}{Quarter to} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\noon} -% \begin{macrocode} -\providecommand*{\noon}{Noon} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\midnight} -% \begin{macrocode} -\providecommand*{\midnight}{Midnight} -% \end{macrocode} -%\end{macro} -%\begin{macro}{\oclockstring} -% \begin{macrocode} -\providecommand*{\oclockstring}{O'Clock} -% \end{macrocode} -%\end{macro} %\begin{macro}{\pdfdate} % Finally create command that will typeset the date in PDF format % e.g. 20040501215500. This is defined regardless of |\if@no@date| % as it's provided for use in |\pdfinfo|. Initially |\pdfdate| is set -% to the year. +% to the year. Note that pdftex provides \cs{pdfcreationdate} +% which also stores the seconds and time zone. %\changes{2.31}{2004/05/01}{new} %\changes{2.32}{2004/05/04}{fixed bug} % \begin{macrocode} @@ -1733,8 +2016,7 @@ past \hourstring{HOURXII}}{% \edef\pdfdate{\the\dt@b\the\dt@a} \fi % \end{macrocode} -% Append the seconds. \TeX\ doesn't store the seconds, so -% set to zero. +% Append the seconds. % \begin{macrocode} \dt@a={00} \dt@b=\expandafter{\pdfdate} @@ -1748,6 +2030,30 @@ past \hourstring{HOURXII}}{% %\fi %\iffalse % \begin{macrocode} +%<*dt-american.def> +% \end{macrocode} +%\fi +%\subsubsection{american} +% Identify file +% \begin{macrocode} +\ProvidesFile{dt-american.def}[2007/06/11] +% \end{macrocode} +\let\dateamerican\usdate + +\let\monthnameamerican\monthnameenglish +\let\shortmonthnameamerican\shortmonthnameenglish + +\let\dayofweeknameidamerican\dayofweeknameidenglish +\let\shortdayofweeknameidamerican\shortdayofweeknameidenglish + +\newcommand*{\ordinaldateamerican}[1]{#1} +%\iffalse +% \begin{macrocode} +%</dt-american.def> +% \end{macrocode} +%\fi +%\iffalse +% \begin{macrocode} %<*dt-austrian.def> % \end{macrocode} %\fi @@ -1944,6 +2250,13 @@ Month numbers should go from 1 (urtarrilaren) to 12 (abenduaren)}% % \begin{macrocode} \ProvidesFile{dt-breton.def}[2004/10/31] % \end{macrocode} +%\begin{macro}{\ordinaldatebreton} +% Breton version: +% \begin{macrocode} +\newcommand*{\ordinaldatebreton}[1]{% +#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} +% \end{macrocode} +%\end{macro} % Define month names. % \begin{macrocode} \providecommand{\monthnamebreton}[1][\month]{% @@ -2025,6 +2338,8 @@ Month numbers should go from 1 (Genver) to 12 (Kerzu)}% \let\dayofweeknameidbritish\dayofweeknameidenglish \let\shortdayofweeknameidbritish\shortdayofweeknameidenglish + +\let\ordinaldatebritish\ordinaldateenglish %\iffalse % \begin{macrocode} %</dt-british.def> @@ -2557,6 +2872,21 @@ Month numbers should go from 1 to 12}% % \begin{macrocode} \ProvidesFile{dt-french.def}[2004/10/31] % \end{macrocode} +%\begin{macro}{\ordinaldatefrench} +% French: +% \begin{macrocode} +\newcommand*{\ordinaldatefrench}[1]{% +#1\ifnum#1=1\ier\fi} +% \end{macrocode} +%\end{macro} +%\begin{macro}{\ier} +% In case \verb|\ier| hasn't been defined:% +%\changes{v2.47}{27 Oct 2005}{defined if it doesn't +% already exist} +% \begin{macrocode} +\providecommand*{\ier}{\textsuperscript{er}} +% \end{macrocode} +%\end{macro} % Define week day names. % \begin{macrocode} \providecommand{\dayofweeknameidfrench}[1]{% @@ -2908,18 +3238,63 @@ Month numbers should go from 1 to 12}% %<*dt-italian.def> % \end{macrocode} %\fi -%\subsubsection{Italian} -% Identify file -% \begin{macrocode} -\ProvidesFile{dt-italian.def}[2004/10/31] -% \end{macrocode} -% Define month names. -% \begin{macrocode} +%% +%% This is file `dt-italian.def', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% datetime.dtx (with options: `dt-italian.def,package') +%% Copyright (C) 2005 Nicola Talbot, all rights reserved. +%% If you modify this file, you must change its name first. +%% You are NOT ALLOWED to distribute this file alone. You are NOT +%% ALLOWED to take money for the distribution or use of either this +%% file or a changed version, except for a nominal charge for copying +%% etc. +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} +\ProvidesFile{dt-italian.def}[2008/01/22] + +% translations provided by Giada Ermacora +\providecommand{\dayofweeknameiditalian}[1]{% +\ifcase#1\relax +\or domenica% +\or luned\`{\i}% +\or marted\`{\i}% +\or mercoled\`{\i}% +\or gioved\`{\i}% +\or venerd\`{\i}% +\or sabato% +\fi} + +\providecommand{\shortdayofweeknameiditalian}[1]{% +\ifcase#1\relax +\or dom% +\or lun% +\or mar% +\or mer% +\or gio% +\or ven% +\or sab% +\fi} + \providecommand{\monthnameitalian}[1][\month]{% \@orgargctr=#1\relax \ifcase\@orgargctr -\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% -Month numbers should go from 1 to 12}% +\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gennaio) to 12 (dicembre)}% \or gennaio% \or febbraio% \or marzo% @@ -2932,18 +3307,36 @@ Month numbers should go from 1 to 12}% \or ottobre% \or novembre% \or dicembre% -\else -\PackageError{datetime}{Invalid Month number \the\@orgargctr}{% -Month numbers should go from 1 to 12}% +\else \PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gennaio) to 12 (dicembre)}% \fi} -% \end{macrocode} -% (Re)Define declaration to switch to this format. -% \begin{macrocode} + +\providecommand{\shortmonthnameitalian}[1][\month]{% +\@orgargctr=#1\relax +\ifcase\@orgargctr +\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gen) to 12 (dic)}% +\or gen% +\or feb% +\or mar% +\or apr% +\or mag% +\or giu% +\or lug% +\or ago% +\or set% +\or ott% +\or nov% +\or dic% +\else% +\PackageError{datetime}{Invalid Month number \the\@orgargctr}{Month numbers should go from 1 (gen) to 12 (dic)}% +\fi} + \DeclareRobustCommand*\dateitalian{% \renewcommand{\formatdate}[3]{% \@day=##1\relax\@month=##2\relax\@year=##3\relax \number\@day\space\monthnameitalian[\@month]\space\number\@year}} -% \end{macrocode} +\endinput +%% +%% End of file `dt-italian.def'. %\iffalse % \begin{macrocode} %</dt-italian.def> @@ -3915,6 +4308,8 @@ Month numbers should go from 1 to 12}% \let\dayofweeknameidUKenglish\dayofweeknameidenglish \let\shortdayofweeknameidUKenglish\shortdayofweeknameidenglish + +\let\ordinaldateUKenglish\ordinaldateenglish %\iffalse % \begin{macrocode} %</dt-UKenglish.def> @@ -3982,6 +4377,8 @@ Month numbers should go from 1 to 12}% \let\dayofweeknameidUSenglish\dayofweeknameidenglish \let\shortdayofweeknameidUSenglish\shortdayofweeknameidenglish + +\newcommand*{\ordinaldateUSenglish}[1]{#1} %\iffalse % \begin{macrocode} %</dt-USenglish.def> @@ -4079,6 +4476,13 @@ Month numbers should go from 1 to 12}% % \begin{macrocode} \ProvidesFile{dt-welsh.def}[2004/10/31] % \end{macrocode} +%\begin{macro}{\ordinaldatewelsh} +% Welsh version: +% \begin{macrocode} +\newcommand*{\ordinaldatewelsh}[1]{% +#1\ifnum#1=1\/\textsuperscript{a\~n}\fi} +% \end{macrocode} +%\end{macro} % Define month names. % \begin{macrocode} \providecommand{\monthnamewelsh}[1][\month]{% |