% \iffalse meta comment
% File: ifw.dtx Copyright (C) 1999 Harald Harders
% \fi
%
% \iffalse
%
%<*isodate>
\def\packagename{isodate}
\def\fileversion{2.04}
\def\filedate{2001/05/04}
\def\docdate{2001/05/17}
\NeedsTeXFormat{LaTeX2e}
%</isodate>
%<*driver>
\documentclass{ltxdoc}
\usepackage[english]{babel}
\IfFileExists{isodate.sty}{\usepackage[english,iso]{isodate}
 \let\isodateSTYfound\active}{\GenericWarning{isodate.dtx}{Package
 file isodate.sty not found (Documentation will be messed up!^^J^^A
 Generate isodate.sty by (La)TeXing isodate.ins, process
 isodate.dtx again)^^J}\stop}
\usepackage{array}
\title{The \texttt{isodate} package\thanks{This file has version 
    \fileversion\ last revised \printdateTeX{\filedate}, 
    documentation dated \printdateTeX{\docdate}.}}
\author{Harald Harders\\\texttt{h.harders@tu-bs.de}}
\date{File Date \printdateTeX{\filedate}, Printed \today}
\newlength{\tempdima}%
\makeatletter
\renewenvironment{table}[1][]{%
  \@float{table}[#1]%
  \centering%
  \setlength{\tempdima}{\abovecaptionskip}%
  \setlength{\abovecaptionskip}{\belowcaptionskip}%
  \setlength{\belowcaptionskip}{\tempdima}%
  }{%
\end@float
}
\makeatother
\EnableCrossrefs
\CodelineIndex
\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter,%
  \gdef,\@ifundefined,\@empty,\@firstoftwo,\@secondoftwo,\@nil,%
  \,,\number,\renewcommand,\setboolean,\whiledo,\ifthenelse}
\DoNotIndex{\setcounter,\space}
\CodelineNumbered
\RecordChanges
\CheckSum{1442}
\begin{document}
 \DocInput{isodate.dtx}
\end{document}
%</driver>
% \fi
%
% \changes{2.00}{2000/08/21}{Total reimplementation of the
% package. The old package has renamed to isodateo.}
% \changes{2.01}{2000/08/24}{For the case that none of the packages
% babel, german, and ngerman is loaded there is a new macro
% \texttt{\textbackslash iso@languagename} that contains the name of
% the last loaded language. If one of the packages is loaded it
% contains the current language.} 
%
% \maketitle
%
% \begin{abstract}
% \noindent This package provides commands to switch between different 
% date formats (standard, ISO, numeric, \LaTeX\ package). They are used by the
% \verb|\today| command, by the \verb|\printdate| and
% \verb|\printdateTeX| commands that print any date, and by the
% \verb|\daterange| command that prints a date range.
% At the moment this package supports German (old and new rules,
% Austrian), British English, US English, French, Danish, and Norwegian.
%
% The idea for this package was taken from the akletter class. 
% \end{abstract}
%
% \tableofcontents
% 
% \section*{Acknowledgements}
%
% First of all I have to thank Axel Kielhorn who wrote the package
% \verb|akletter| which inspired me to write \verb|isodate|. The help
% of Heiko Oberdiek was necessary to handle characters in substrings
% which resulted in the package \verb|substr|. David Sanderson found
% the bug which disabled \verb|isodate| to work without
% \verb|babel|. He also helped me to improve the documentation and
% sent me a link to the ISO 8601 norm \cite{iso8601a}.
% Svend Tollak Munkejord has added the norwegian language.
%
% \section{Commands}
% 
% \subsection{Switching the date format}
%
% This package provides five commands to switch the output format of
% all commands that print dates (described later):
% \medskip 
%
% \DescribeMacro{\isodate}%
% \DescribeMacro{\numdate}%
% \DescribeMacro{\shortdate}%
% \DescribeMacro{\TeXdate}%
% \DescribeMacro{\origdate}%
% \begin{tabular}{@{}ll}
% \verb|\isodate|&date format described in ISO 8601 and DIN 5008
% \cite{iso8601a}\\
% &(yyyy-mm-dd)\\
% \verb|\numdate|&numeric date format with four digits of the year\\
% \verb|\shortdate|&short numeric date format with two digits of the
% year\\
% \verb|\TeXdate|&date format used for version description of 
% packages\\
% &(yyyy/mm/dd)\\
% \verb|\origdate|&original \LaTeX\ format
% \end{tabular}
% \medskip 
%
% The numeric and short numeric format change their behaviour
% depending on the actual language:
%
% \noindent\begin{tabular}{@{}llll@{}}
% German, nGerman&\verb|dd.\,mm.~yyyy|&resp.&\verb|dd.\,mm.\,yy|\\
% US English&\verb|mm/dd/yyyy|&resp.&\verb|mm/dd/yy|\\ 
% other languages&\verb|dd/mm/yyyy|&resp.&\verb|dd/mm/yy|
% \end{tabular}
%
% This package supports German (old and new rules, Austrian), US
% English, French, Danish, and Norwegian.
% Switching the language by using \verb|\selectlanguage| does \emph{not}
% switch back to the original date format. So the current date format
% stays active when changing the language.
%
% The change of the date format works locally. So it is possible to
% change it locally inside a group. E.g.
% \begin{verbatim}
% \today, {\origdate\today}, \today
% \end{verbatim}
% leads to ``\today, {\origdate\today}, \today''.
%
% \subsection{Printing today's date}
%
% \DescribeMacro{\today}%
% As usual the command \verb|\today| prints the date of today. Its
% appearance is influenced by the current date format
%
% \subsection{Printing any date}
%
% \DescribeMacro{\printdate}%
% The command \verb|\printdate{#1}| prints any date in the current
% format. The argument may be a date in German, British English, or
% ISO format, e.g.\\
% \begin{verbatim}
% \printdate{24.12.2000}
% \printdate{24/12/2000}
% \printdate{2000-12-24}
% \end{verbatim}
%
% \DescribeMacro{\printdateTeX}%
% The command \verb|\printdateTeX{#1}| prints any date in the actual
% format. The argument must be in the \LaTeX\ format \verb|yyyy/mm/dd|, e.g.\\
% \begin{verbatim}
% \printdateTeX{2000/12/24}
% \end{verbatim}
% This command is useful for printing version information stored in a
% macro. For example the version of this documentation is stored in
% the macro \verb|\docdate| (``\docdate''). To print it with the actual
% date format you can use the command \verb|\printdateTeX{\docdate}|
% which leads to e.g. ``\printdateTeX{\docdate}'' or
% {\origdate``\printdateTeX{\docdate}''}.
%
% \subsection{Printing date ranges}
%
% \DescribeMacro{\daterange}%
% The command \verb|\daterange{#1}{#2}| prints a date range in the current
% format. The arguments may be a date in German, British English, or
% ISO format (see above). But there is a limitation: Both arguments
% must have the same input format.
%
% Depending on the language and date format this commands lets out some 
% of the data. The simplest way to understand it is to watch some
% examples:\\
% \verb|{\isodate|{\isodate\\
% \verb|\daterange{1999-05-03}{1999-05-31}| $\longrightarrow$
%   \daterange{1999-05-03}{1999-05-31}\\
% \verb|\daterange{1999-05-03}{1999-11-03}| $\longrightarrow$
%   \daterange{1999-05-03}{1999-11-03}\\
% \verb|\daterange{1999-05-03}{2000-04-07}| $\longrightarrow$
%   \daterange{1999-05-03}{2000-04-07}\\
% \verb|}|}\\
% \verb|{\origdate|{\origdate\\
% \verb|\daterange{1999-05-03}{1999-05-31}| $\longrightarrow$
%   \daterange{1999-05-03}{1999-05-31}\\
% \verb|\daterange{1999-05-03}{1999-11-03}| $\longrightarrow$
%   \daterange{1999-05-03}{1999-11-03}\\
% \verb|\daterange{1999-05-03}{2000-04-07}| $\longrightarrow$
%   \daterange{1999-05-03}{2000-04-07}\\
% \verb|}|}
%
% \subsection{Changing the ISO format}
%
% \DescribeMacro{\isodash}%
% The ISO norm says that the date format is ``yyyy-mm-dd'' or
% ``yyyymmdd'' \cite{iso8601a}.
% By default I use the hyphen ``-'' as separator. You can change this
% using the \verb|\isodash|\footnote{The name ``isodash'' is a little
% bit confusing and was chosen due to my limited knowledge in
% English. It should be named ``isoseparator'' or ``isosep''. But for 
% compatiblity reasons I will not change it.} command, e.g. 
% \begin{verbatim}
% \printdate{24/12/2000},
% \isodash{--}%
% \printdate{24/12/2000},
% \isodash{}%
% \printdate{24/12/2000}
% \end{verbatim}
% leads to ``2000-12-24, 2000--12--24, 20001224''. Or for example
% \begin{verbatim}
% \isodash{$\cdot$}
% \printdate{24/12/2000}
% \end{verbatim}
% leads to ``2000$\cdot$12$\cdot$24''.
%
%
% \subsection{Changing the German format}
%
% \changes{2.03}{2001/05/04}{Allow change of spaces for German language}%
% The spacings for the numerical formats in the German language 
% (24.\,12.~2000 resp. 24.\,12.\,00) was taken from the Duden
% \cite{duden1996a} and is the default spacing when using one of the
% German derivatives.
% Some people want to use different spacings. Thus from version 2.03 on it 
% will be possible to change it.
% \DescribeMacro{\daymonthsepgerman}%
% \DescribeMacro{\monthyearsepgerman}%
% You can change the spacing between the day and the month using the 
% command \verb|\daymonthsepgerman|. Using the command
% \verb|\monthyearsepgerman| you can change the spacing between the
% month and the year for the long and the short format, e.g.
% \begin{verbatim}
% \daymonthsepgerman{\quad}%
% \monthyearsepgerman{\qquad}{\quad}%
% {\numdate\printdate{24.12.2000}}, {\shortdate\printdate{24.12.2000}}
% \end{verbatim}
% leads to ``24.\quad12.\qquad2000, 24.\quad12.\quad00''.
%
% \section{Calling the package}
%
% The package is called using the \verb|\usepackage| command:\\
% \verb|\usepackage[|option\verb|]{isodate}|. 
%
% The possible package options can be seen in table~\ref{tab:options}.
% %
% \begin{table}[h!tbp]
% \centering
% \caption{Package options}
% \label{tab:options}
% \begin{tabular}{ll}\hline
% option&function\\ \hline
% \verb|iso|&start with ISO date format\\
% \verb|num|&start with numeric date format with 4 digits of the year\\
% \verb|short|&start with numeric date format with 2 digits of the year\\
% \verb|TeX|&start with \LaTeX\ numeric date format (yyyy/mm/dd)\\
% \verb|orig|&start with normal \LaTeX\ date format (default)\\
% \hline
% \verb|american|&support American English date format\\
% \verb|austrian|&support Austrian date format\\
% \verb|danish|&support Danish date format\\
% \verb|english|&support British English date format\\
% \verb|french|&support French date format\\
% \verb|german|&support German date format\\
% \verb|naustrian|&support new Austrian date format\\
% \verb|ngerman|&support new German date format\\
% \verb|norsk|&support Norwegian date format\\
% \verb|norwegian|&support Norwegian date format\\
% \hline
% \end{tabular}
% \end{table}
%
% \emph{Be aware that at least one language option must be set when calling
% isodate.} The last language in the option list is the default language.
%
% The package isodate works well together with \verb|babel.sty|,
% \verb|german.sty|, or \verb|ngerman.sty|. Maybe it also works
% together with other language packages like e.g. \verb|french.sty|,
% but this has not been tested. It does not matter if \verb|isodate|
% is loaded before or after the used language package.
%
% It is also possible to use isodate without one of the language
% packages. Then it is not possible to switch between languages using 
% the \verb|\selectlanguage| command.\footnote{Yes, there is a way to
% change the date language, but it is a little bit tricky:\\
% \texttt{\textbackslash makeatletter\\
% \textbackslash def\textbackslash iso@languagename\{german\}\%\\
% \textbackslash dategerman\%\\
% \textbackslash makeatother}} 
% Then the default language is the last one in the option list. If an
% error occurs when using isodate without one of the packages
% \verb|babel.sty|, \verb|german.sty|, and \verb|ngerman.sty| please
% run \verb|tstlang.tex| through latex and send the file
% \verb|tstlang.log| to the address \verb|h.harders@tu-bs.de|.
%
% If using isodate
% together with babel it can be useful to put the language options as 
% global options into the optional parameters of the
% \verb|\documentclass| command.
% Then automatically the available languages are the same for the text
% and the dates, and the default language is also the same.
% For example:
% \begin{verbatim}
% \documentclass[english,german]{article}
% \usepackage{babel}
% \usepackage[num]{isodate}
% \end{verbatim}
%
% \section{Add new languages to the package}
%
% The easiest way to add new languages to the package is to copy one
% of the simple language files \verb|danish.idf| or \verb|french.idf|
% to the new language name, e.g. \verb|plattdeutsch.idf|, and change it
% as necessary.
%
% This new file can be used without changing \verb|isodate.sty| if you 
% use its name explicitly in the optional parameter of the
% \verb|\usepackage| command. If you have added support for a new
% language please mail me.
%
% \section{Solvable problems}%
% \changes{2.04}{2001/05/17}{Added section for solvable problems.}
%
% \subsection{Redefinition of language dependent names}
%
% If someone wants to change one of the language dependent names (e.g.
% \verb|\contentsname|, \verb|\figurename|, \dots) many people just write
% (e.g. in the language \verb|ngerman|)
% \begin{verbatim}
% \renewcommand{\contentsname}{Inhalt}
% \end{verbatim}
% in the preamble of the document.
% If they are using \verb|german.sty|, \verb|ngerman.sty|, or no language
% package (and not \verb|isodate.sty|) this approach works. But when
% using \verb|babel.sty| and/or \verb|isodate.sty| the default
% (``Inhaltsverzeichnis'') results. This is due to the fact that these
% packages call the command \verb|\selectlanguage| at the 
% \verb|\begin{document}|.
%
% Depending on the used package different solutions have to be used.
%
% Using \verb|babel.sty| the redefinition of the name has to be added to
% the language extras:
% \begin{verbatim}
% \addto{\extrasngerman}{\renewcommand{\contentsname}{Inhalt}}
% \end{verbatim}
%
% Using \verb|german.sty| or \verb|ngerman.sty| this approach does not work.
% Instead, the \verb|\selectlanguage| command has to be redefined.
% First, the original command has to be copied via the \verb|\let| command.
% Then the \verb|\selectcommand| is redefined using the original command:
% \begin{verbatim}
% \let\origselectlanguage=\selectlanguage
% \def\selectlanguage#1{\origselectlanguage{#1}%
%   \iflanguage{ngerman}{\renewcommand{\contentsname}{Inhalt}}{%
%   \iflanguage{german}{\renewcommand{\contentsname}{Inhalt}}{}}}
%  \selectlanguage{ngerman}
% \end{verbatim}
%
% These commands should be placed shortly before the \verb|\begin{document}|
% command.
%
% \appendix
% 
% \section{Licence} 
% 
% Copyright 2000 Harald Harders
%
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
% 
% \section{Known errors}
%
% \begin{itemize} 
% \item The \verb|\printdate| and \verb|\printdateTeX| commands are not
% very good in checking the argument for correct syntax.
% \item I don't know the French word that should be used in a date
% range. So I have taken \verb|~--~| (``~--~'').
% \item The language definition files \verb|french.idf| and
% \verb|german.idf| are not yet commented.
% \end{itemize}
%
% \section{Planned features and changes}
%
% \begin{itemize}
% \item Of course eliminate the errors.
% \item Add other languages than German, new German, English,
%   US English, French, Danish, and Norwegian.
%   Please help me with this topic. I don't know the date formats in
%   other languages.
% \end{itemize}
%
% \section{Literature}
%
% \begin{thebibliography}{1}
% \bibitem{iso8601a}
%   International Standard: ISO~8601.
%   \newblock http://www.iso.ch/markete/8601.pdf, 1988-06-15.
% \bibitem{duden1996a}
%   DUDEN Band 1.
%   \newblock Die deutsche Rechtschreibung.
%   \newblock 21. Auf\/lage, Dudenverlag, Mannheim, Germany, 1996.
% \end{thebibliography}
%                                
% \StopEventually{\PrintChanges \PrintIndex}
%
%
% \section{The implementation}
%
% \subsection{Package file isodate.sty}
% \iffalse
%<*isodate>
% \fi
% Heading of the package:
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{isodate}[\filedate\space v\fileversion
  Change the output format of dates (HH)]
\RequirePackage{ifthen}
\RequirePackage{calc}
\IfFileExists{substr.sty}{\RequirePackage{substr}%
 }{\PackageError{isodate.sty}{Package file substr.sty not found}
   {This version of isodate.sty needs the package substr.sty.^^J%
     You can download it from
     CTAN:/macros/latex/contrib/supported/substr/^^J%
     E.g. one CTAN node is ftp.dante.de.
     Install substr.sty into your TeX tree.}}
%    \end{macrocode}
% Declare the options for the default date format.
%    \begin{macrocode}
\DeclareOption{iso}{\AtBeginDocument{\isodate}}
\DeclareOption{num}{\AtBeginDocument{\numdate}}
\DeclareOption{short}{\AtBeginDocument{\shortdate}}
\DeclareOption{TeX}{\AtBeginDocument{\TeXdate}}
\DeclareOption{orig}{\AtBeginDocument{\origdate}}
%    \end{macrocode}
% Declare the options for language support.
%    \begin{macrocode}
\DeclareOption{austrian}{\input{german.idf}}
\DeclareOption{english}{\input{english.idf}}
\DeclareOption{german}{\input{german.idf}}
\DeclareOption{american}{\input{english.idf}}
\DeclareOption{naustrian}{\input{german.idf}}
\DeclareOption{ngerman}{\input{german.idf}}
\DeclareOption{UKenglish}{\input{english.idf}}
\DeclareOption{USenglish}{\input{english.idf}}
\DeclareOption{danish}{\input{danish.idf}}
\DeclareOption{norsk}{\input{norsk.idf}}
\DeclareOption{norwegian}{\input{norsk.idf}}
\DeclareOption{french}{\input{french.idf}}
%    \end{macrocode}
% Make it possible to load language definition files that are not
% known by this package.
%    \begin{macrocode}
\DeclareOption*{%
  \InputIfFileExists{\CurrentOption.idf}{}{%
    \PackageError{isodate}{%
      Isodate definition file \CurrentOption.idf not found}{%
      Maybe you misspelled the language option?}}%
  }
%    \end{macrocode}
% Set default option to \verb|orig|.
%    \begin{macrocode}
\ExecuteOptions{orig}
%    \end{macrocode}
% Process the options.
%    \begin{macrocode}
\ProcessOptions*
%    \end{macrocode}
% Handle the case that no language was given. Throw an error message.
% Each language definition file \verb|*.idf| must contain a line
% \begin{verbatim}
% \let\iso@languageloaded\active
% \end{verbatim}
% that defines the command \verb|\iso@languageloaded|.
%    \begin{macrocode}
\ifx\iso@languageloaded\@undefined
  \PackageError{isodate}{%
    You haven't specified a language option}{%
    You need to specify a language, either as a global
    option\MessageBreak
    or as an optional argument to the \string\usepackage\space
    command.\MessageBreak
    If you have used the old isodate package (version <=1.06) you can
    change the\MessageBreak
    usepackage command to \protect\usepackage{isodate}.\MessageBreak
    You shouldn't try to proceed from here, type x to quit.}
\fi
%    \end{macrocode}
% \begin{macro}{\printnumber}
% Prints a number. If the optional parameter is used the number has
% two digits and it is filled by ``0''.
%
% Examples:
% \verb|\printnumber{4}| $\longrightarrow$ \printnumber{4}, 
% \verb|\printnumber[g]{4}| $\longrightarrow$ \printnumber[g]{4}.
%    \begin{macrocode}
\newcommand{\printnumber}[2][\@empty]{%
  \ifthenelse{\equal{#1}{\@empty}}{}{%
    \ifthenelse{\number#2<10}{0}{}}\number#2}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@yeartwo}
% Prints the argument of the command with two
% digits. 
%
% Example: \verb|\iso@yeartwo{1873}| $\longrightarrow$
% \makeatletter\iso@yeartwo{1873}\makeatother.
%    \begin{macrocode}
\newcounter{iso@yeartwo}%
\newcommand{\iso@yeartwo}[1]{%
  \setcounter{iso@yeartwo}{\number#1}%
  \whiledo{\theiso@yeartwo>99}{%
    \setcounter{iso@yeartwo}{\theiso@yeartwo-100}}{}%
  \ifthenelse{\number\theiso@yeartwo<10}{0}{}\theiso@yeartwo}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@dateformat}
% In this command the current active date format ist stored. Possible
% values are: \verb|numeric|, \verb|short|, \verb|iso|, \verb|orig|,
% \verb|TeX|.
%    \begin{macrocode}
\def\iso@dateformat{numeric}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\numdate}
% Switches to long numerical date format.
%    \begin{macrocode}
\DeclareRobustCommand*{\numdate}{\def\iso@dateformat{numeric}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\shortdate}
% Switches to short numerical date format.
%    \begin{macrocode}
\DeclareRobustCommand*{\shortdate}{\def\iso@dateformat{short}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\isodate}
% Switches to ISO date format.
%    \begin{macrocode}
\DeclareRobustCommand*{\isodate}{\def\iso@dateformat{iso}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\origdate}
% Switches to the original date format.
%    \begin{macrocode}
\DeclareRobustCommand*{\origdate}{\def\iso@dateformat{orig}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\TeXdate}
% Switches to \LaTeX\ date format.
%    \begin{macrocode}
\DeclareRobustCommand*{\TeXdate}{\def\iso@dateformat{TeX}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\isodash}
% Changes the dash in the ISO date format. The default is ``-''.
%    \begin{macrocode}
\def\iso@isodash{-}%
\DeclareRobustCommand*{\isodash}[1]{\def\iso@isodash{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\isorangesign}
% Defines the sign or word that is printed between the two dates in a
% date range. E.g. in English the default is ``~to~''.
%    \begin{macrocode}
\def\iso@rangesign{\csname iso@rangesign@\iso@languagename\endcsname}%
\DeclareRobustCommand*{\isorangesign}[1]{\def\iso@rangesign{#1}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate}
% Defines the command \verb|iso@printdate| which takes three arguments 
% (year, month, day) and prints the date by using the \verb|\today| command.
%    \begin{macrocode}
\newcommand{\iso@printdate}[3]{%
  \begingroup%
  \def\year{#1}%
  \def\month{#2}%
  \def\day{#3}%
  \today%
  \endgroup%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\printdate}
% Prints a date that is given as one argument in one of these formats: 
% \verb|yyyy-mm-dd|, \verb|dd/mm/yyyy|, \verb|dd.mm.yyyy|.
%    \begin{macrocode}
\DeclareRobustCommand*{\printdate}[1]{%
%    \end{macrocode}
% Define \verb|\iso@date| command to expand the argument \verb|#1|.
%    \begin{macrocode}
  \edef\iso@date{#1}%
%    \end{macrocode}
% Count appearances of ``/'', ``-'', and ``.'' in the argument.
%    \begin{macrocode}
  \SubStringsToCounter{iso@slash}{/}{\iso@date}%
  \SubStringsToCounter{iso@minus}{-}{\iso@date}%
  \SubStringsToCounter{iso@dot}{.}{\iso@date}%
%    \end{macrocode}
% If number of ``.'' in the argument is equal to 2 then the German
% format \verb|dd.mm.yyyy| is used.
%    \begin{macrocode}
  \ifthenelse{\equal{\theiso@dot}{2}}{%
    \expandafter\iso@input@german\iso@date\@empty}{%
%    \end{macrocode}
% If number of ``-'' in the argument is equal to 2 then the ISO
% format \verb|yyyy-mm-dd| is used.
%    \begin{macrocode}
    \ifthenelse{\equal{\theiso@minus}{2}}{%
      \expandafter\iso@input@iso\iso@date\@empty}{%
%    \end{macrocode}
% If number of ``/'' in the argument is equal to 2 then the British English
% format \verb|dd/mm/yyyy| is used.
%    \begin{macrocode}
      \ifthenelse{\equal{\theiso@slash}{2}}{%
        \expandafter\iso@input@english\iso@date\@empty}{%
%    \end{macrocode}
% Else no of the formats above is used an thus an error message is thrown.
%    \begin{macrocode}
        ????\iso@isodash ??\iso@isodash ??%
        \PackageError{isodate}{unrecognized date format}{Use one of
          the following formats as macro argument:^^J%
          \space\space dd.mm.yyyy^^J%
          \space\space dd/mm/yyyy^^J%
          \space\space yyyy-mm-dd^^J%
          Don't use any spaces or commands like \protect\, or
          \protect~ inside the argument.}%
        }}}%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@input@iso}
% Converts a string with the format \verb|yyyy-mm-dd| to three
% arguments \verb|{#1}{#2}{#3}| and calls \verb|\iso@printdate|.
%    \begin{macrocode}
\def\iso@input@iso#1-#2-#3\@empty{\iso@printdate{#1}{#2}{#3}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@input@german}
% Converts a string with the format \verb|dd.mm.yyyy| to three
% arguments \verb|{#3}{#2}{#1}| and calls \verb|\iso@printdate|.
%    \begin{macrocode}
\def\iso@input@german#1.#2.#3\@empty{\iso@printdate{#3}{#2}{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@input@english}
% Converts a string with the format \verb|dd/mm/yyyy| to three
% arguments \verb|{#3}{#2}{#1}| and calls \verb|\iso@printdate|.
%    \begin{macrocode}
\def\iso@input@english#1/#2/#3\@empty{\iso@printdate{#3}{#2}{#1}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\printdateTeX}
% Prints a date that is given as one argument in the format
% \verb|yyyy/mm/dd|.
%    \begin{macrocode}
\DeclareRobustCommand*{\printdateTeX}[1]{%
%    \end{macrocode}
% Define \verb|\iso@date| command to expand the argument \verb|#1|.
%    \begin{macrocode}
  \edef\iso@date{#1}%
%    \end{macrocode}
% Count appearances of ``/'' in the argument.
%    \begin{macrocode}
  \SubStringsToCounter{iso@slash}{/}{\iso@date}%
%    \end{macrocode}
% If number of ``/'' in the argument is equal to 2 then the \LaTeX\
% format \verb|yyyy/mm/dd| is used.
%    \begin{macrocode}
  \ifthenelse{\equal{\theiso@slash}{2}}{%
    \expandafter\iso@input@TeX\iso@date\@empty}{%
%    \end{macrocode}
% Else no of the formats above is used an thus an error message is thrown.
%    \begin{macrocode}
    ????\iso@isodash ??\iso@isodash ??%
    \PackageError{isodate}{unrecognized date format}{Use one of
      the following formats as macro argument:^^J%
      \space\space dd.mm.yyyy^^J%
      \space\space dd/mm/yyyy^^J%
      \space\space yyyy-mm-dd^^J%
      Don't use any spaces or commands like \protect\, or
      \protect~ inside the argument.}%
    }}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@input@TeX}
% Converts a string with the format \verb|yyyy/mm/dd| to three
% arguments \verb|{#1}{#2}{#3}| and calls \verb|\iso@printdate|.
%    \begin{macrocode}
\def\iso@input@TeX#1/#2/#3\@empty{\iso@printdate{#1}{#2}{#3}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\daterange}
% Prints a date range.
%    \begin{macrocode}
\DeclareRobustCommand*{\daterange}[2]{%
%    \end{macrocode}
% Define \verb|\iso@date| and \verb|\iso@@date| commands to expand the
% argument \verb|#1| and \verb|#2|. Define \verb|\iso@@@date| which
% contains both arguments devided by a komma.
%    \begin{macrocode}
  \edef\iso@date{#1}%
  \edef\iso@@date{#2}%
  \edef\iso@@@date{\iso@date,\iso@@date}%
%    \end{macrocode}
% Count appearances of ``/'', ``-'', and ``.'' in the arguments.
%    \begin{macrocode}
  \SubStringsToCounter{iso@slash}{/}{\iso@date}%
  \SubStringsToCounter{iso@minus}{-}{\iso@date}%
  \SubStringsToCounter{iso@dot}{.}{\iso@date}%
  \SubStringsToCounter{iso@@slash}{/}{\iso@@date}%
  \SubStringsToCounter{iso@@minus}{-}{\iso@@date}%
  \SubStringsToCounter{iso@@dot}{.}{\iso@@date}%
%    \end{macrocode}
% If number of ``.'' in both arguments is equal to 2 then the German
% format \verb|dd.mm.yyyy| is used.
%    \begin{macrocode}
  \ifthenelse{\equal{\theiso@dot}{2}\and\equal{\theiso@@dot}{2}}{%
    \expandafter\iso@range@input@german\iso@@@date\@empty}{%
%    \end{macrocode}
% If number of ``-'' in both arguments is equal to 2 then the ISO
% format \verb|yyyy-mm-dd| is used.
%    \begin{macrocode}
    \ifthenelse{\equal{\theiso@minus}{2}\and\equal{\theiso@@minus}{2}}{%
      \expandafter\iso@range@input@iso\iso@@@date\@empty}{%
%    \end{macrocode}
% If number of ``/'' in both arguments is equal to 2 then the British English
% format \verb|dd/mm/yyyy| is used.
%    \begin{macrocode}
      \ifthenelse{\equal{\theiso@slash}{2}\and%
                  \equal{\theiso@@slash}{2}}{%
        \expandafter\iso@range@input@english\iso@@@date\@empty}{%
%    \end{macrocode}
% Else no of the formats above is used an thus an error message is thrown.
%    \begin{macrocode}
        ????\iso@isodash ??\iso@isodash ??%
        \PackageError{isodate}{unrecognized date format}{Use one of
          the following formats as macro argument:^^J%
          \space\space dd.mm.yyyy^^J%
          \space\space dd/mm/yyyy^^J%
          \space\space yyyy-mm-dd^^J%
          Don't use any spaces or commands like \protect\, or
          \protect~ inside the argument.^^J
          Use the same format for both arguments.}%
        }}}%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@range@input@iso}
% Converts a string with the format \verb|yyyy-mm-dd,yyyy-mm-dd| to six
% arguments \verb|{#1}{#2}{#3}{#4}{#5}{#6}| and calls
% \verb|\iso@daterange@|language. 
%    \begin{macrocode}
\def\iso@range@input@iso#1-#2-#3,#4-#5-#6\@empty{%
  \csname iso@daterange@\iso@languagename\endcsname{%
    #1}{#2}{#3}{#4}{#5}{#6}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@range@input@german}
% Converts a string with the format \verb|dd.mm.yyyy,dd.mm.yyyy| to six
% arguments \verb|{#3}{#2}{#1}{#6}{#5}{#4}| and calls
% \verb|\iso@daterange@|language. 
%    \begin{macrocode}
\def\iso@range@input@german#1.#2.#3,#4.#5.#6\@empty{%
  \csname iso@daterange@\iso@languagename\endcsname{%
    #3}{#2}{#1}{#6}{#5}{#4}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@range@input@english}
% Converts a string with the format \verb|dd/mm/yyyy,dd/mm/yyyy| to six
% arguments \verb|{#3}{#2}{#1}{#6}{#5}{#4}| and calls
% \verb|\iso@daterange@|language. 
%    \begin{macrocode}
\def\iso@range@input@english#1/#2/#3,#4/#5/#6\@empty{%
  \csname iso@daterange@\iso@languagename\endcsname{%
    #3}{#2}{#1}{#6}{#5}{#4}}
%    \end{macrocode}
% \end{macro}
% Define the counters for conting the appearances of ``.'', ``-'', and 
% ''/'' in the arguments.
%    \begin{macrocode}
\newcounter{iso@slash}
\newcounter{iso@minus}
\newcounter{iso@dot}
\newcounter{iso@@slash}
\newcounter{iso@@minus}
\newcounter{iso@@dot}
%    \end{macrocode}
% The command \verb|\iso@languagename| is defined to be able to use
% this package without loading one of the language packages
% babel.sty, german.sty, or ngerman.sty.
%
% If neither babel.sty nor german.sty nor ngerman.sty is loaded my
% computer returns ``nohyphenation'' when using \verb|\languagename|.
% So this is the indication that none of the above packages is loaded.
% \changes{2.01}{2000/08/24}{Handle case of not loaded language
% package babel, german and ngerman}
%    \begin{macrocode}
\AtBeginDocument{%
  \ifthenelse{\not\equal{\languagename}{nohyphenation}}{%
%    \end{macrocode}
% The language is not equal ``nohyphenation''. So one of the language
% packages is loaded. Replace the internal language name
% \verb|\iso@languagename| by the global language name \verb|\languagename|.
%    \begin{macrocode}
    \gdef\iso@languagename{\languagename}%
%    \end{macrocode}
% Reload language to surely switch to new date format. The
% languagename gets first expanded because of errors that would occur 
% otherwise.
%    \begin{macrocode}
    \edef\iso@tmplang{\languagename}%
    \expandafter\selectlanguage\expandafter{\iso@tmplang}%
  }{%
%    \end{macrocode}
% None of the language packages are loaded. So no language switching
% is possible. Set the date language manually to the last language
% that was loaded for isodate.
%    \begin{macrocode}
    \csname date\iso@languagename\endcsname%
  }
}
%    \end{macrocode}
% The end of the package.
% \iffalse
%</isodate>
% \fi
%
% \subsection{Language definition file danish.idf}
% \iffalse
%<*danish>
% \fi
% Heading of the file:
%    \begin{macrocode}
\ProvidesFile{danish.idf}[\filedate\space v\fileversion\space
  Danish support from the isodate package]
%    \end{macrocode}
% \begin{macro}{\iso@languageloaded}
% Define the command \verb|\iso@languageloaded| in order to enable
% \verb|isodate.sty| to determine if at least one language is loaded.
%    \begin{macrocode}
\let\iso@languageloaded\active
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\month@danish}
% Prints the name of today's month in the long form for the original
% date format.
%    \begin{macrocode}
\def\month@danish{\ifcase\month\or
    januar\or februar\or marts\or april\or maj\or juni\or
    juli\or august\or september\or oktober\or november\or december\fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printmonthday@danish}
% Prints the month and the day given as two arguments
% (\verb|{mm}{dd}|) in the current date format.
%    \begin{macrocode}
  \def\iso@printmonthday@danish#1#2{%
%    \end{macrocode}
% Numeric and short date format: \verb|dd/mm/|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
      \equal{\iso@dateformat}{short}}{%
      \printnumber[10]{#2}/\printnumber[10]{#1}/}{%
%    \end{macrocode}
% ISO date format: \verb|-mm-dd|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{iso}}{%
        \iso@isodash\printnumber[10]{#1}%
        \iso@isodash\printnumber[10]{#2}}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|/mm/dd|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
          /\printnumber[10]{#1}/\printnumber[10]{#2}}{%
%    \end{macrocode}
% Original date format: \verb|d. mmm|
%    \begin{macrocode}
          \ifthenelse{\equal{\iso@dateformat}{orig}}{%
            \printnumber{#2}.~\begingroup
            \edef\lmonth{#1}\def\month{\lmonth}%
            \month@danish%
            \endgroup
            }{}}}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@danish}
% Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
% the actual date format
%    \begin{macrocode}
  \def\iso@printdate@danish#1#2#3{%
%    \end{macrocode}
% ISO or \LaTeX date format: \verb|yyyy\iso@printmonthday@danish|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{iso}\or%
      \equal{\iso@dateformat}{TeX}}{\number#1}{}%
    \iso@printmonthday@danish{\number#2}{\number#3}%
%    \end{macrocode}
% numeric date format: \verb|\iso@printmonthday@danish yyyy|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
%    \end{macrocode}
% original date format: \verb|\iso@printmonthday@danish~yyyy|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
%    \end{macrocode}
% short date format: \verb|\iso@printmonthday@danish yy|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{short}}{%
          \iso@yeartwo{\number#1}}{%
          }}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@datedanish}
% This command redefines the \verb|\today| command to print in the
% actual date format.
%    \begin{macrocode}
  \def\iso@datedanish{%
    \def\today{\iso@printdate@danish{\year}{\month}{\day}}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@daterange@danish}
% This command takes six arguments
% (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
% date range in the actual date format.
%    \begin{macrocode}
\def\iso@daterange@danish#1#2#3#4#5#6{%
%    \end{macrocode}
% ISO or \LaTeX\ date format.
%    \begin{macrocode}
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
%    \end{macrocode}
% Print the start date.
%    \begin{macrocode}
    \csname iso@printdate@\iso@languagename\endcsname{%
      #1}{#2}{#3}\iso@rangesign%
%    \end{macrocode}
% If year and month are equal, only print the day of the end date. If
% only the year is equal, only print month and day of the end
% date. Otherwise print the whole end date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\iso@printmonthday@danish{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
%    \end{macrocode}
% Numeric, short, or original date format.
%
% If year and month are equal, only print the day of the start date. If
% only the year is equal, only print month and day of the start
% date. Otherwise print the whole start date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \printnumber{#3}.}{\printnumber[10]{#3}}%
        }{\iso@printmonthday@danish{#2}{#3}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{%
        #1}{#2}{#3}}%
%    \end{macrocode}
% Print the end date.
%    \begin{macrocode}
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}%
}{%
    }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@rangesign@danish}
% Sets the word between start and end date in a date range to ``~til~''.
%    \begin{macrocode}
\def\iso@rangesign@danish{~til~}
%    \end{macrocode}
% \end{macro}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
\def\iso@languagename{danish}%
%    \end{macrocode}
% Redefine the command \verb|\datedanish| that is used by babel to
% switch to the original Danish date format to enable the use of
% different date formats.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\iso@datedanish\else
    \def\datedanish{\iso@datedanish}%
  \fi
}
%    \end{macrocode}
% The end of the file.
%
% \iffalse
%</danish>
% \fi
%
% \subsection{Language definition file english.idf}
% \iffalse
%<*english>
% \fi
% Heading of the file:
%    \begin{macrocode}
\ProvidesFile{english.idf}[\filedate\space v\fileversion\space
  English support from the isodate package]
%    \end{macrocode}
% \begin{macro}{\iso@languageloaded}
% Define the command \verb|\iso@languageloaded| in order to enable
% \verb|isodate.sty| to determine if at least one language is loaded.
%    \begin{macrocode}
\let\iso@languageloaded\active
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\month@english}
% Prints the name of today's month in the long form for the original
% date format.
%    \begin{macrocode}
\def\month@english{\ifcase\month\or
    January\or February\or March\or April\or May\or June\or
    July\or August\or September\or October\or November\or December\fi}
%    \end{macrocode}
% \end{macro}
% British and American English dates are very different. So handle
% them seperately. It might have been easier to put them in different
% files but I wanted to organize my files analogous to babel.
%
% First handle British English.
%    \begin{macrocode}
\ifthenelse{\equal{\CurrentOption}{english}\or%
            \equal{\CurrentOption}{UKenglish}}{%
%    \end{macrocode}
% \begin{macro}{\day@english}
% Prints today's day for the original date format.
%    \begin{macrocode}
  \def\day@english{\ifcase\day\or
    1st\or 2nd\or 3rd\or 4th\or 5th\or
    6th\or 7th\or 8th\or 9th\or 10th\or
    11th\or 12th\or 13th\or 14th\or 15th\or
    16th\or 17th\or 18th\or 19th\or 20th\or
    21st\or 22nd\or 23rd\or 24th\or 25th\or
    26th\or 27th\or 28th\or 29th\or 30th\or
    31st\fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printmonthday@english}
% Prints the month and the day given as two arguments
% (\verb|{mm}{dd}|) in the current date format.
%    \begin{macrocode}
  \def\iso@printmonthday@english#1#2{%
%    \end{macrocode}
% Numeric and short date format: \verb|dd/mm/|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
      \equal{\iso@dateformat}{short}}{%
      \printnumber[10]{#2}/\printnumber[10]{#1}/}{%
%    \end{macrocode}
% ISO date format: \verb|mm-dd|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{iso}}{%
        \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|mm/dd|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
          \printnumber[10]{#1}/\printnumber[10]{#2}}{%
%    \end{macrocode}
% Original date format: \verb|ddd mmm|
%    \begin{macrocode}
          \ifthenelse{\equal{\iso@dateformat}{orig}}{%
            \begingroup
            \edef\lday{#2}\def\day{\lday}%
            \edef\lmonth{#1}\def\month{\lmonth}%
            \day@english~\month@english%
            \endgroup
            }{}}}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@english}
% Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
% the actual date format.
%    \begin{macrocode}
  \def\iso@printdate@english#1#2#3{%
%    \end{macrocode}
% ISO date format: \verb|yyyy-\iso@printmonthday@english|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|yyyy/\iso@printmonthday@english|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
    \iso@printmonthday@english{\number#2}{\number#3}%
%    \end{macrocode}
% Numeric date format: \verb|\iso@printmonthday@english yyyy|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
%    \end{macrocode}
% Original date format: \verb|\iso@printmonthday@english~yyyy|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
%    \end{macrocode}
% Short date format: \verb|\iso@printmonthday@english yy|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{short}}{%
          \iso@yeartwo{\number#1}}{%
          }}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@UKenglish}
% Just a second name for \verb|\iso@printdate@UKenglish|.
%    \begin{macrocode}
  \def\iso@printdate@UKenglish{\iso@printdate@english}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@dateenglish}
% This command redefines the \verb|\today| command to print in the
% actual date format.
%    \begin{macrocode}
  \def\iso@dateenglish{%
    \def\today{\iso@printdate@english{\year}{\month}{\day}}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@daterange@english}
% This command takes six arguments
% (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
% date range in the actual date format.
%    \begin{macrocode}
\def\iso@daterange@english#1#2#3#4#5#6{%
%    \end{macrocode}
% ISO or \LaTeX\ date format.
%    \begin{macrocode}
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
%    \end{macrocode}
% Print the start date.
%    \begin{macrocode}
    \csname iso@printdate@\iso@languagename\endcsname{%
      #1}{#2}{#3}\iso@rangesign%
%    \end{macrocode}
% If year and month are equal, only print the day of the end date. If
% only the year is equal, only print month and day of the end
% date. Otherwise print the whole end date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\iso@printmonthday@english{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
%    \end{macrocode}
% Numeric, short, or original date format.
%
% If year and month are equal, only print the day of the start date. If
% only the year is equal, only print month and day of the start
% date. Otherwise print the whole start date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \begingroup
            \edef\lday{#3}\def\day{\lday}%
            \day@english\endgroup}{\printnumber[10]{#3}}%
        }{\iso@printmonthday@english{#2}{#3}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
%    \end{macrocode}
% Print the end date.
%    \begin{macrocode}
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}%
}{%
    }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@daterange@english}
% Sets the word between start and end date in a date range to ``~to''.
%    \begin{macrocode}
\def\iso@rangesign@english{~to~}
%    \end{macrocode}
% \end{macro}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
\def\iso@languagename{english}%
%    \end{macrocode}
% The end of the British section.
%
% Second handle American English.
%    \begin{macrocode}
}{%
%    \end{macrocode}
% \begin{macro}{\iso@printmonthday@american}
% Prints the month and the day given as two arguments
% (\verb|{mm}{dd}|) in the current date format.
%    \begin{macrocode}
  \def\iso@printmonthday@american#1#2{%
%    \end{macrocode}
% Numeric and short date format: \verb|mm/dd/|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
      \equal{\iso@dateformat}{short}}{%
      \printnumber[10]{#1}/\printnumber[10]{#2}/}{%
%    \end{macrocode}
% ISO date format: \verb|mm-dd|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{iso}}{%
        \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|mm/dd|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
          \printnumber[10]{#1}/\printnumber[10]{#2}}{%
%    \end{macrocode}
% Original date format: \verb|mmm d|
%    \begin{macrocode}
          \ifthenelse{\equal{\iso@dateformat}{orig}}{%
            \begingroup%
            \edef\lmonth{#1}%
            \def\month{\lmonth}\month@english%
            \endgroup
            ~\printnumber{#2}%
            }{}}}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@american}
% Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
% the actual date format.
%    \begin{macrocode}
  \def\iso@printdate@american#1#2#3{%
%    \end{macrocode}
% ISO date format: \verb|yyyy-\iso@printmonthday@american|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|yyyy/\iso@printmonthday@american|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
    \iso@printmonthday@american{\number#2}{\number#3}%
%    \end{macrocode}
% Numeric date format: \verb|\iso@printmonthday@american yyyy|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
%    \end{macrocode}
% Original date format: \verb|\iso@printmonthday@american,~yyyy|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{orig}}{,~\number#1}{%
%    \end{macrocode}
% Short date format: \verb|\iso@printmonthday@american yy|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{short}}{%
          \iso@yeartwo{\number#1}}{}}}%
  }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@USenglish}
% Just a second name for \verb|\iso@printdate@UKamerican|.
%    \begin{macrocode}
  \def\iso@printdate@USenglish{\iso@printdate@american}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@dateamerican}
% This command redefines the \verb|\today| command to print in the
% actual date format.
%    \begin{macrocode}
  \def\iso@dateamerican{%
    \def\today{\iso@printdate@american{\year}{\month}{\day}}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@daterange@american}
% This command takes six arguments
% (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
% date range in the actual date format.
%    \begin{macrocode}
\def\iso@daterange@american#1#2#3#4#5#6{%
%    \end{macrocode}
% ISO or \LaTeX\ date format.
%    \begin{macrocode}
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
%    \end{macrocode}
% Print the start date.
%    \begin{macrocode}
    \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
    \iso@rangesign%
%    \end{macrocode}
% If year and month are equal, only print the day of the end date. If
% only the year is equal, only print month and day of the end
% date. Otherwise print the whole end date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\iso@printmonthday@american{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{%
        #4}{#5}{#6}}}{%
%    \end{macrocode}
% Original date format.
%
% If year and month are equal, print \verb|mmm d1 to d2, yyyy|. If
% only the year is equal, print \verb|mmm1 d1 to mmm2 d2, yyyy|. 
% Otherwise print the whole start and end date.
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{orig}}{%
      \ifthenelse{\equal{\number#1}{\number#4}}{%
        \ifthenelse{\equal{\number#2}{\number#5}}{%
          \iso@printmonthday@american{#2}{#3}\iso@rangesign%
          \printnumber{#6},~\number#4}{%
          \iso@printmonthday@american{#2}{#3}\iso@rangesign%
          \csname iso@printdate@\iso@languagename\endcsname{%
            #4}{#5}{#6}}}{%
        \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
        \iso@rangesign%
        \csname iso@printdate@\iso@languagename\endcsname{%
          #4}{#5}{#6}}}{%
%    \end{macrocode}
% Numeric or short date format.
%
% If year and month are equal, only print the day of the end date.
% Otherwise print the whole end date.
%    \begin{macrocode}
      \ifthenelse{\equal{\number#1}{\number#4}}{%
      \iso@printmonthday@american{#2}{#3}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
%    \end{macrocode}
% Print the end date.
%    \begin{macrocode}
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}}%
  }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@rangesign@american}
% Set the word between start and end date in a date range to ``~to~''.
%    \begin{macrocode}
\def\iso@rangesign@american{~to~}
%    \end{macrocode}
% \end{macro}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
\def\iso@languagename{american}%
%    \end{macrocode}
% The end of the American section.
%    \begin{macrocode}
}
%    \end{macrocode}
% Redefine the command \verb|date|language that is used by babel.sty,
% german.sty, and ngerman.sty to switch to the original
% English/American date format to enable the use of different date
% formats.
%
% Do this only if \verb|\iso@date|language is defined.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\iso@dateenglish\else
    \def\dateenglish{\iso@dateenglish}%
    \def\dateUKenglish{\iso@dateenglish}%
  \fi
  \ifx\undefined\iso@dateamerican\else
    \def\dateamerican{\iso@dateamerican}%
    \def\dateUSenglish{\iso@dateamerican}%
  \fi
}
%    \end{macrocode}
% The end of the file.
%
% \iffalse
%</english>
% \fi
%
% \subsection{Language definition file french.idf}
% \iffalse
%<*french>
% \fi
% Heading of the file:
%    \begin{macrocode}
\ProvidesFile{french.idf}[\filedate\space v\fileversion\space
  French support from the isodate package]
%    \end{macrocode}
% \begin{macro}{\iso@languageloaded}
% Define the command \verb|\iso@languageloaded| in order to enable
% \verb|isodate.sty| to determine if at least one language is loaded.
%    \begin{macrocode}
\let\iso@languageloaded\active
%    \end{macrocode}
% \end{macro}
%    \begin{macrocode}
\def\month@french{\ifcase\month\or
  janvier\or f\'evrier\or mars\or avril\or mai\or juin\or
  juillet\or ao\^ut\or septembre\or octobre\or novembre\or
  d\'ecembre\fi}
%    \end{macrocode}
%    \begin{macrocode}
  \def\iso@printmonthday@french#1#2{%
    \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
      \equal{\iso@dateformat}{short}}{%
      \printnumber[10]{#2}/\printnumber[10]{#1}/}{%
      \ifthenelse{\equal{\iso@dateformat}{iso}}{%
        \iso@isodash\printnumber[10]{#1}\iso@isodash%
        \printnumber[10]{#2}}{%
        \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
          /\printnumber[10]{#1}/\printnumber[10]{#2}}{%
          \ifthenelse{\equal{\iso@dateformat}{orig}}{%
            \begingroup
            \edef\lday{#2}\edef\day{\lday}%
            \edef\lmonth{#1}\def\month{\lmonth}%
            \number\day\ifnum1=\day \noexpand\ier\fi~\month@french%
            \endgroup
            }{}}}}%
    }
%    \end{macrocode}
%    \begin{macrocode}
  \def\iso@printdate@french#1#2#3{%
    \ifthenelse{\equal{\iso@dateformat}{iso}\or%
      \equal{\iso@dateformat}{TeX}}{\number#1}{}%
    \iso@printmonthday@french{\number#2}{\number#3}%
    \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
      \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
        \ifthenelse{\equal{\iso@dateformat}{short}}{%
          \iso@yeartwo{\number#1}}{}}}%
    }
%    \end{macrocode}
%    \begin{macrocode}
  \def\iso@datefrench{%
    \def\today{\iso@printdate@french{\year}{\month}{\day}}}%
%    \end{macrocode}
%    \begin{macrocode}
\def\iso@daterange@french#1#2#3#4#5#6{%
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
    \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
    \iso@rangesign%
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\iso@printmonthday@french{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
%    \end{macrocode}
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \begingroup
            \edef\lday{#3}\edef\day{\lday}%
            \number\day\ifnum1=\day \noexpand\ier\fi
            \endgroup}{\printnumber[10]{#3}}%
        }{\iso@printmonthday@french{#2}{#3}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}%
}{%
    }%
}
%    \end{macrocode}
%    \begin{macrocode}
\def\iso@rangesign@french{~--~}
%    \end{macrocode}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
\def\iso@languagename{french}%
%    \end{macrocode}
% \changes{2.03}{2001/05/04}{Fixed a bug in the French language that caused
%   not to switch to it correctly on startup.}
% \verb|\datefrenchb| has to be defined additionally because babel starts
% with language frenchb instead of french.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\iso@datefrench\else
    \def\datefrench{\iso@datefrench}%
    \def\datefrenchb{\iso@datefrench}%
  \fi
}
%    \end{macrocode}
% The end of the file.
%
% \iffalse
%</french>
% \fi
%
% \subsection{Language definition file german.idf}
% \iffalse
%<*german>
% \fi
% Heading of the file:
%    \begin{macrocode}
\ProvidesFile{german.idf}[\filedate\space v\fileversion\space
  German support from the isodate package]
%    \end{macrocode}
% \begin{macro}{\iso@languageloaded}
% Define the command \verb|\iso@languageloaded| in order to enable
% \verb|isodate.sty| to determine if at least one language is loaded.
%    \begin{macrocode}
\let\iso@languageloaded\active
%    \end{macrocode}
% \end{macro}
% \changes{2.03}{2001/05/04}{Allow change of spaces for German language}%
% Define spaces between day and month resp. month and year. \verb|dm| 
% stands for day-month and \verb|my| for month-year. The defaults are taken
% from the Duden \cite{duden1996a}.
%    \begin{macrocode}
\def\iso@dmsepgerman{\,}%
\def\iso@mylongsepgerman{~}%
\def\iso@myshortsepgerman{\,}%
%    \end{macrocode}
% \begin{macro}{\daymonthsepgerman}
% Change space between day and month in numeric date formats for the
% German language. The only parameter is the new spacing.
%    \begin{macrocode}
\DeclareRobustCommand*{\daymonthsepgerman}[1]{\def\iso@dmsepgerman{#1}}
%    \begin{macrocode}
% \end{macro}
% \begin{macro}{\monthyearsepgerman}
% Change space between month and year in numeric date formats for the
% German language. The first parameter is the new spacing for the long
% format and the second for the short format.
%    \begin{macrocode}
\DeclareRobustCommand*{\monthyearsepgerman}[2]{%
  \def\iso@mylongsepgerman{#1}%
  \def\iso@myshortsepgerman{#2}}
%    \end{macrocode}
% \end{macro}
% \changes{2.02}{2000/10/03}{Changed the umlauts to normal \TeX\ commands to
% be able to use German dates without german.sty or babel.sty.}
%    \begin{macrocode}
\def\month@german{\ifcase\month\or
  Januar\or Februar\or M\"arz\or April\or Mai\or Juni\or
  Juli\or August\or September\or Oktober\or November\or Dezember\fi}
\def\month@ngerman{\month@german}
\def\month@austrian{\ifnum1=\month
  J\"anner\else \month@german\fi}
\def\month@naustrian{\month@austrian}
%    \end{macrocode}
%    \begin{macrocode}
\@namedef{iso@printmonthday@\CurrentOption}#1#2{%
  \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
              \equal{\iso@dateformat}{short}}{%
    \printnumber[10]{#2}.\iso@dmsepgerman\printnumber[10]{#1}.}{%
    \ifthenelse{\equal{\iso@dateformat}{iso}}{%
      \printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%
      \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
        \printnumber[10]{#1}/\printnumber[10]{#2}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \printnumber{#2}.~\begingroup
          \edef\lmonth{#1}%
          \def\month{\lmonth}\csname month@\iso@languagename\endcsname%
          \endgroup
          }{}}}}%
}
%    \end{macrocode}
%    \begin{macrocode}
\@namedef{iso@printdate@\CurrentOption}#1#2#3{%
  \ifthenelse{\equal{\iso@dateformat}{iso}}{\number#1\iso@isodash}{%
    \ifthenelse{\equal{\iso@dateformat}{TeX}}{\number#1/}{}}%
  \csname iso@printmonthday@\iso@languagename\endcsname{%
    \number#2}{\number#3}%
  \ifthenelse{\equal{\iso@dateformat}{numeric}}{%
    \iso@mylongsepgerman\number#1}{%
    \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
      \ifthenelse{\equal{\iso@dateformat}{short}}{%
        \iso@myshortsepgerman\iso@yeartwo{\number#1}}{}}}%
}
%    \end{macrocode}
%    \begin{macrocode}
\@namedef{iso@daterange@\CurrentOption}#1#2#3#4#5#6{%
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
    \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
    \iso@rangesign%
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\csname iso@printmonthday@\iso@languagename\endcsname{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
%    \end{macrocode}
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \printnumber{#3}}{\printnumber[10]{#3}}.%
        }{\csname iso@printmonthday@\iso@languagename\endcsname{%
          #2}{#3}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}%
  }%
}
%    \end{macrocode}
%    \begin{macrocode}
\@namedef{iso@rangesign@\CurrentOption}{~bis~}
%    \end{macrocode}
%    \begin{macrocode}
\ifthenelse{\equal{\CurrentOption}{german}}{%
  \def\iso@dategerman{%
    \def\today{\iso@printdate@german{\year}{\month}{\day}}}%
%    \end{macrocode}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
  \def\iso@languagename{german}%
}{%
%    \end{macrocode}
%    \begin{macrocode}
\ifthenelse{\equal{\CurrentOption}{ngerman}}{%
  \def\iso@datengerman{%
    \def\today{\iso@printdate@ngerman{\year}{\month}{\day}}}%
%    \end{macrocode}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
  \def\iso@languagename{ngerman}%
}{%
%    \end{macrocode}
%    \begin{macrocode}
\ifthenelse{\equal{\CurrentOption}{austrian}}{%
  \def\iso@dateaustrian{%
    \def\today{\iso@printdate@austrian{\year}{\month}{\day}}}%
%    \end{macrocode}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
  \def\iso@languagename{austrian}%
}{%
%    \end{macrocode}
%    \begin{macrocode}
\ifthenelse{\equal{\CurrentOption}{naustrian}}{%
  \def\iso@datenaustrian{%
    \def\today{\iso@printdate@naustrian{\year}{\month}{\day}}}%
%    \end{macrocode}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
  \def\iso@languagename{naustrian}%
}{%
}}}}
%    \end{macrocode}
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\iso@dategerman\else
    \def\dategerman{\iso@dategerman}%
  \fi
  \ifx\undefined\iso@datengerman\else
    \def\datengerman{\iso@datengerman}%
  \fi
  \ifx\undefined\iso@dateaustrian\else
    \def\dateaustrian{\iso@dateaustrian}%
  \fi
  \ifx\undefined\iso@datenaustrian\else
    \def\datenaustrian{\iso@datenaustrian}%
  \fi
}
%    \end{macrocode}
% The end of the file.
%
% \iffalse
%</german>
% \fi
%
%
% \changes{2.02}{2001/04/30}{Added Norwegian language by Svend Tollak
% Munkejord}
% \subsection{Language definition file norsk.idf}
% 
% This file was provided by Svend Tollak Munkejord
% (svend.t.munkejord@energy.sintef.no).
%
% \iffalse
%<*norsk>
% \fi
% Heading of the file:
%    \begin{macrocode}
%% Endret til norsk, 2001-04-30, STM
\ProvidesFile{norsk.idf}[\filedate\space v\fileversion\space
  Norwegian support from the isodate package]
%    \end{macrocode}
% \begin{macro}{\iso@languageloaded}
% Define the command \verb|\iso@languageloaded| in order to enable
% \verb|isodate.sty| to determine if at least one language is loaded.
%    \begin{macrocode}
\let\iso@languageloaded\active
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\month@norsk}
% Prints the name of today's month in the long form for the original
% date format.
%    \begin{macrocode}
\def\month@norsk{\ifcase\month\or
    januar\or februar\or mars\or april\or mai\or juni\or
    juli\or august\or september\or oktober\or november\or desember\fi}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printmonthday@norsk}
% Prints the month and the day given as two arguments
% (\verb|{mm}{dd}|) in the current date format.
%    \begin{macrocode}
  \def\iso@printmonthday@norsk#1#2{%
%    \end{macrocode}
% Numeric and short date format: \verb|dd/mm/|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}\or%
      \equal{\iso@dateformat}{short}}{%
      \printnumber[10]{#2}/\printnumber[10]{#1}/}{%
%    \end{macrocode}
% ISO date format: \verb|-mm-dd|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{iso}}{%
        \iso@isodash\printnumber[10]{#1}\iso@isodash\printnumber[10]{#2}}{%
%    \end{macrocode}
% \LaTeX\ date format: \verb|/mm/dd|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{TeX}}{%
          /\printnumber[10]{#1}/\printnumber[10]{#2}}{%
%    \end{macrocode}
% Original date format: \verb|d. mmm|
%    \begin{macrocode}
          \ifthenelse{\equal{\iso@dateformat}{orig}}{%
            \printnumber{#2}.~\begingroup
            \edef\lmonth{#1}\def\month{\lmonth}%
            \month@norsk%
            \endgroup
            }{}}}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@printdate@norsk}
% Prints the date given as three arguments (\verb|{yyyy}{mm}{dd}|) in
% the actual date format
%    \begin{macrocode}
  \def\iso@printdate@norsk#1#2#3{%
%    \end{macrocode}
% ISO or \LaTeX date format: \verb|yyyy\iso@printmonthday@norsk|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{iso}\or%
      \equal{\iso@dateformat}{TeX}}{\number#1}{}%
    \iso@printmonthday@norsk{\number#2}{\number#3}%
%    \end{macrocode}
% numeric date format: \verb|\iso@printmonthday@norsk yyyy|
%    \begin{macrocode}
    \ifthenelse{\equal{\iso@dateformat}{numeric}}{\number#1}{%
%    \end{macrocode}
% original date format: \verb|\iso@printmonthday@norsk~yyyy|
%    \begin{macrocode}
      \ifthenelse{\equal{\iso@dateformat}{orig}}{~\number#1}{%
%    \end{macrocode}
% short date format: \verb|\iso@printmonthday@norsk yy|
%    \begin{macrocode}
        \ifthenelse{\equal{\iso@dateformat}{short}}{%
          \iso@yeartwo{\number#1}}{%
          }}}%
    }
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@datenorsk}
% This command redefines the \verb|\today| command to print in the
% actual date format.
%    \begin{macrocode}
  \def\iso@datenorsk{%
    \def\today{\iso@printdate@norsk{\year}{\month}{\day}}}%
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@daterange@norsk}
% This command takes six arguments
% (\verb|{yyyy1}{mm1}{dd1}{yyyy2}{mm2}{dd2}|) and prints the corrosponding
% date range in the actual date format.
%    \begin{macrocode}
\def\iso@daterange@norsk#1#2#3#4#5#6{%
%    \end{macrocode}
% ISO or \LaTeX\ date format.
%    \begin{macrocode}
  \ifthenelse{\equal{\iso@dateformat}{iso}\or%
              \equal{\iso@dateformat}{TeX}}{%
%    \end{macrocode}
% Print the start date.
%    \begin{macrocode}
    \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}%
    \iso@rangesign%
%    \end{macrocode}
% If year and month are equal, only print the day of the end date. If
% only the year is equal, only print month and day of the end
% date. Otherwise print the whole end date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{\printnumber[10]{#6}%
        }{\iso@printmonthday@norsk{#5}{#6}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#4}{#5}{#6}}}{%
%    \end{macrocode}
% Numeric, short, or original date format.
%
% If year and month are equal, only print the day of the start date. If
% only the year is equal, only print month and day of the start
% date. Otherwise print the whole start date.
%    \begin{macrocode}
    \ifthenelse{\equal{\number#1}{\number#4}}{%
      \ifthenelse{\equal{\number#2}{\number#5}}{%
        \ifthenelse{\equal{\iso@dateformat}{orig}}{%
          \printnumber{#3}.}{\printnumber[10]{#3}}%
        }{\iso@printmonthday@norsk{#2}{#3}}}{%
      \csname iso@printdate@\iso@languagename\endcsname{#1}{#2}{#3}}%
%    \end{macrocode}
% Print the end date.
%    \begin{macrocode}
    \iso@rangesign\csname iso@printdate@\iso@languagename\endcsname{%
      #4}{#5}{#6}%
}{%
    }%
}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\iso@rangesign@norsk}
% Sets the word between start and end date in a date range to ``~til~''.
%    \begin{macrocode}
\def\iso@rangesign@norsk{~til~}
%    \end{macrocode}
% \end{macro}
% Define the language name that will the active language for isodate
% if none of the packages babel.sty, german.sty, and ngerman.sty is
% loaded and if this is the last language that is used for isodate.
% If one of the above packages is used this definition will be
% overridden by the command \verb|\languagename| that will always
% return the current used language.
%    \begin{macrocode}
\def\iso@languagename{norsk}%
%    \end{macrocode}
% Redefine the command \verb|\datenorsk| that is used by babel to
% switch to the original Norsk date format to enable the use of
% different date formats.
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\undefined\iso@datenorsk\else
    \def\datenorsk{\iso@datenorsk}%
  \fi
}
%    \end{macrocode}
% The end of the file.
%
% \iffalse
%</norsk>
% \fi
%
% \Finale
