summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/isodate/testdate.tex
blob: 818ca4916b908bff70e5b348598f5044e65b5fb5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
\documentclass[spanish,swedish,norsk,italian,danish,french,USenglish,english,australian,newzealand,naustrian,ngerman,a4paper,fleqn,11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
%\usepackage[iso,cleanlook]{isodate}
\usepackage[iso,nocleanlook]{isodate}
%\usepackage{ngerman}
%\usepackage{bibgerm}
%\shortyearsign{'}
%\printyearoff
\printdayoff

\overfullrule1mm

\setlength{\parindent}{0mm}
\addtolength\textheight{10\baselineskip}
\addtolength\topmargin{-4\baselineskip}
\addtolength\textwidth{6mm}

\makeatletter
\newcommand{\example}[2][]{%
  \@ifundefined{l@#2}{%
    \section*{Language: #2}
    Not available since babel does not know this language.
  }{%
  \selectlanguage{#2}
%  \ifthenelse{\equal{#2}{american}}{\dateamerican}{}%
  \section*{Language: \languagename#1}
  \begin{tabular}{@{}lll}
    today&normal date format&``\origdate\today''\\
    &short original&``\shortorigdate\today''\\
    &isodate&``\isodate\today''\\
    &numdate&``\numdate\today''\\
    &shortdate&``\shortdate\today''\\
    &TeXdate&``\TeXdate\today''\\
    &Romandate&``\Romandate\today''\\
    &romandate&``\romandate\today''\\
    &shortRomandate&``\shortRomandate\today''\\
    &shortromandate&``\shortromandate\today''\\
    &back to normal&``\origdate\today''\\
    another day&normal date format&``\origdate\printdate{1972-1-9}''\\
    &short original&``\shortorigdate\printdate{9.1.1972}''\\
    &isodate&``\isodate\printdate{9.1.1972}''\\
    &numdate&``\numdate\printdate{1972-1-9}''\\
    &shortdate&``\shortdate\printdate{1972-1-9}''\\
    &TeXdate&``\TeXdate\printdate{1972-1-9}''\\
    &Romandate&``\Romandate\printdate{1972-1-9}''\\
    &romandate&``\romandate\printdate{1972-1-9}''\\
    &shortRomandate&``\shortRomandate\printdate{1972-1-9}''\\
    &shortromandate&``\shortromandate\printdate{1972-1-9}''\\
    &back to normal&``\origdate\printdate{9/1/1972}''\\
    range 1&normal date format&``\origdate\daterange{1972-1-30}{1972-1-31}''\\
    &short original&``\shortorigdate\daterange{1972-1-30}{1972-1-31}''\\
    &isodate&``\isodate\daterange{1972-1-30}{1972-1-31}''\\
    &numdate&``\numdate\daterange{1972-1-30}{1972-1-31}''\\
    &shortdate&``\shortdate\daterange{1972-1-30}{1972-1-31}''\\
    &TeXdate&``\TeXdate\daterange{1972-1-30}{1972-1-31}''\\
    &Romandate&``\Romandate\daterange{1972-1-30}{1972-1-31}''\\
    &back to normal&``\origdate\daterange{1972-1-30}{1972-1-31}''\\
    range 2&normal date format&``\origdate\daterange{1972-1-30}{1972-2-28}''\\
    &short original&``\shortorigdate\daterange{1972-1-30}{1972-2-28}''\\
    &isodate&``\isodate\daterange{1972-1-30}{1972-2-28}''\\
    &numdate&``\numdate\daterange{1972-1-30}{1972-2-28}''\\
    &shortdate&``\shortdate\daterange{1972-1-30}{1972-2-28}''\\
    &TeXdate&``\TeXdate\daterange{1972-1-30}{1972-2-28}''\\
    &Romandate&``\Romandate\daterange{1972-1-30}{1972-2-28}''\\
    &back to normal&``\origdate\daterange{1972-1-30}{1972-2-28}''\\
    range 3&normal date format&``\origdate\daterange{1972-1-30}{2001-1-28}''\\
    &short original&``\shortorigdate\daterange{1972-1-30}{2001-1-28}''\\
    &isodate&``\isodate\daterange{1972-1-30}{2001-1-28}''\\
    &numdate&``\numdate\daterange{1972-1-30}{2001-1-28}''\\
    &shortdate&``\shortdate\daterange{1972-1-30}{2001-1-28}''\\
    &TeXdate&``\TeXdate\daterange{1972-1-30}{2001-1-28}''\\
    &back to normal&``\origdate\daterange{1972-1-30}{2001-1-28}''\\
  \end{tabular}%

  {\origdate A very, very long line with a linebreak within the date to test
    linebreak: \printdate{2007-04-09}}

  {\isospacebeforeyear{\ }%
    \isospacebeforemonth{\ }%
    \isospacebeforeday{\ }%
    \origdate A very, very long line with a linebreak within the date to test
    linebreak: \printdate{2007-04-09}}

  }%
}
\makeatother
\begin{document}
%\today

%\monthyearsepgerman{\qquad}{\quad}%
%\daymonthsepgerman{\quad}%

\example{ngerman}
\example{naustrian}
\example{english}
\example{australian}
%\example{newzealand}
\example{USenglish}
%\example{american}
\example{french}
\example{danish}
\example{italian}
\example{norsk}
\example{swedish}
\example[ (not defined in isodate)]{spanish}

\selectlanguage{english}%

\section*{Changed ISO output}
\isodate
\printdate{24/12/2000}

\isodash{--}
\printdate{24/12/2000}

\isodash{$\cdot$}
\printdate{24.12.2000}

\section*{Strange date formats}
\numdate[Alph]
\printdate{4.1.2000}

\printdate{4.2.2000}

\printdate{1.11.2000}

\printdate{4.12.2000}

\numdate[Alph]%
\isotwodigitdayfalse
\printdate{4.1.2000}

\printdate{4.2.2000}

\printdate{1.11.2000}

\printdate{4.12.2000}

\def\tuetel#1{\textsuperscript{\twodigitarabic{#1}}}
\numdate[tuetel]
\printdate{4.1.2000}

\printdate{4.2.2000}

\printdate{1.11.2000}

\printdate{4.12.2000}

\selectlanguage{ngerman}
\numdate
\printdate{4.12.0002}

\shortdate
\printdate{4.12.0002}

\selectlanguage{spanish}
\printdate{4.12.0002}

\section*{Test input format}
\selectlanguage{english}%
\isodate\isodash{-}%

\dateinputformat{english}%
\printdate{31/12/2004} (english \verb|\printdate{31/12/2004}|)

\daterange{31/12/2004}{15/01/2005}

\dateinputformat{USenglish}%
\printdate{12/31/2004} (american \verb|\printdate{12/31/2004}|)

\daterange{12/31/2004}{01/15/2005}


\dateinputformat{tex}%
\printdate{2004/12/31} (tex \verb|\printdate{2004/12/31}|)

\daterange{2004/12/31}{2005/01/15}



\end{document}