Skip to content
Permalink
Browse files

[acgiowt] (1) extend timezone format to also allow omitting the colon

git-svn-id: http://svn.whatwg.org/webapps@6829 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 18, 2011
1 parent d94963c commit 00a107c2d456f4e7c37eb6474ea5bd288a834a8e
Showing with 153 additions and 49 deletions.
  1. +46 −15 complete.html
  2. +46 −15 index
  3. +61 −19 source
representing the hours component <var title="">hour</var> of
the time-zone offset, in the range 0&nbsp;&le;&nbsp;<var title="">hour</var>&nbsp;&le;&nbsp;23</li>

<li>A U+003A COLON character (:)</li>
<li>Optionally, a U+003A COLON character (:)</li>

<li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
representing the minutes component <var title="">minute</var>
in <var title="">input</var>.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var title="">s</var> be the collected sequence.</li>

<li>

<p>If <var title="">s</var> is exactly two characters long, then
run these substeps:</p>

<ol><li><p>Interpret <var title="">s</var> as a base-ten integer.
Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>If <var title="">position</var> is beyond the end of
<var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>

</ol><p>If <var title="">s</var> is exactly four characters long,
then run these substeps:</p>

<ol><li><p>Interpret the first two characters of <var title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>Interpret the last two characters of <var title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub title="">minutes</sub></var>.</li>

</ol><p>Otherwise, fail.</p>

</li>

<li>If <var title="">timezone<sub title="">hours</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var title="">timezone<sub title="">hours</sub></var>&nbsp;&le;&nbsp;23, then fail.</li>

<li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>

<li>If <var title="">timezone<sub title="">minutes</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var title="">timezone<sub title="">minutes</sub></var>&nbsp;&le;&nbsp;59, then fail.</li>

<dd>

<pre class=example>&lt;time&gt;Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;-08:00&lt;/time&gt;</pre>

</dd>
<pre class=example>&lt;time&gt;2011-11-12T14:54Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922Z&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T14:54+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922+0000&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T14:54+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922+00:00&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T06:54-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39.92922-0800&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T06:54-08:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39-08:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39.92922-08:00&lt;/time&gt;</pre>
61 index
representing the hours component <var title="">hour</var> of
the time-zone offset, in the range 0&nbsp;&le;&nbsp;<var title="">hour</var>&nbsp;&le;&nbsp;23</li>

<li>A U+003A COLON character (:)</li>
<li>Optionally, a U+003A COLON character (:)</li>

<li>Two <a href=#concept-datetime-digit title=concept-datetime-digit>digits</a>,
representing the minutes component <var title="">minute</var>
in <var title="">input</var>.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var title="">s</var> be the collected sequence.</li>

<li>

<p>If <var title="">s</var> is exactly two characters long, then
run these substeps:</p>

<ol><li><p>Interpret <var title="">s</var> as a base-ten integer.
Let that number be the <var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>If <var title="">position</var> is beyond the end of
<var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>

</ol><p>If <var title="">s</var> is exactly four characters long,
then run these substeps:</p>

<ol><li><p>Interpret the first two characters of <var title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>Interpret the last two characters of <var title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub title="">minutes</sub></var>.</li>

</ol><p>Otherwise, fail.</p>

</li>

<li>If <var title="">timezone<sub title="">hours</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var title="">timezone<sub title="">hours</sub></var>&nbsp;&le;&nbsp;23, then fail.</li>

<li>If <var title="">sign</var> is "negative", then negate <var title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>If <var title="">position</var> is beyond the end of <var title="">input</var> or if the character at <var title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</li>

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub title="">minutes</sub></var>.</li>

<li>If <var title="">timezone<sub title="">minutes</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var title="">timezone<sub title="">minutes</sub></var>&nbsp;&le;&nbsp;59, then fail.</li>

<dd>

<pre class=example>&lt;time&gt;Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;-08:00&lt;/time&gt;</pre>

</dd>
<pre class=example>&lt;time&gt;2011-11-12T14:54Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39Z&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922Z&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T14:54+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39+0000&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922+0000&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T14:54+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39+00:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T14:54:39.92922+00:00&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T06:54-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39-0800&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39.92922-0800&lt;/time&gt;</pre>

<pre class=example>&lt;time&gt;2011-11-12T06:54-08:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39-08:00&lt;/time&gt;</pre>
<pre class=example>&lt;time&gt;2011-11-12T06:54:39.92922-08:00&lt;/time&gt;</pre>
80 source
@@ -5346,7 +5346,7 @@ is conforming depends on which specs apply, and leaves it at that. -->
the time-zone offset, in the range 0&nbsp;&le;&nbsp;<var
title="">hour</var>&nbsp;&le;&nbsp;23</li>

<li>A U+003A COLON character (:)</li>
<li>Optionally, a U+003A COLON character (:)</li>

<li>Two <span title="concept-datetime-digit">digits</span>,
representing the minutes component <var title="">minute</var>
@@ -5442,11 +5442,54 @@ is conforming depends on which specs apply, and leaves it at that. -->
in <var title="">input</var>.</p></li>

<li><p><span>Collect a sequence of characters</span> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub
title="">hours</sub></var>.</p></li>
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). Let <var
title="">s</var> be the collected sequence.</p></li>

<li>

<p>If <var title="">s</var> is exactly two characters long, then
run these substeps:</p>

<ol>

<li><p>Interpret <var title="">s</var> as a base-ten integer.
Let that number be the <var title="">timezone<sub
title="">hours</sub></var>.</p></li>

<li><p>If <var title="">position</var> is beyond the end of
<var title="">input</var> or if the character at <var
title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</p></li>

<li><p><span>Collect a sequence of characters</span> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub
title="">minutes</sub></var>.</p></li>

</ol>

<p>If <var title="">s</var> is exactly four characters long,
then run these substeps:</p>

<ol>

<li><p>Interpret the first two characters of <var
title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub title="">hours</sub></var>.</p></li>

<li><p>Interpret the last two characters of <var
title="">s</var> as a base-ten integer. Let that number be the
<var title="">timezone<sub
title="">minutes</sub></var>.</p></li>

</ol>

<p>Otherwise, fail.</p>

</li>

<li>If <var title="">timezone<sub title="">hours</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var
@@ -5456,19 +5499,6 @@ is conforming depends on which specs apply, and leaves it at that. -->
<li>If <var title="">sign</var> is "negative", then negate <var
title="">timezone<sub title="">hours</sub></var>.</li>

<li><p>If <var title="">position</var> is beyond the end of <var
title="">input</var> or if the character at <var
title="">position</var> is not a U+003A COLON character, then
fail. Otherwise, move <var title="">position</var> forwards one
character.</p></li>

<li><p><span>Collect a sequence of characters</span> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). If the collected
sequence is not exactly two characters long, then
fail. Otherwise, interpret the resulting sequence as a base-ten
integer. Let that number be the <var title="">timezone<sub
title="">minutes</sub></var>.</p></li>

<li>If <var title="">timezone<sub title="">minutes</sub></var> is
not a number in the range 0&nbsp;&le;&nbsp;<var
title="">timezone<sub
<dd>

<pre class="example">&lt;time>Z&lt;/time></pre>
<pre class="example">&lt;time>+0000&lt;/time></pre>
<pre class="example">&lt;time>+00:00&lt;/time></pre>
<pre class="example">&lt;time>-0800&lt;/time></pre>
<pre class="example">&lt;time>-08:00&lt;/time></pre>

</dd>
<pre class="example">&lt;time>2011-11-12T14:54Z&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39Z&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39.92922Z&lt;/time></pre>

<pre class="example">&lt;time>2011-11-12T14:54+0000&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39+0000&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39.92922+0000&lt;/time></pre>

<pre class="example">&lt;time>2011-11-12T14:54+00:00&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39+00:00&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T14:54:39.92922+00:00&lt;/time></pre>

<pre class="example">&lt;time>2011-11-12T06:54-0800&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T06:54:39-0800&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T06:54:39.92922-0800&lt;/time></pre>

<pre class="example">&lt;time>2011-11-12T06:54-08:00&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T06:54:39-08:00&lt;/time></pre>
<pre class="example">&lt;time>2011-11-12T06:54:39.92922-08:00&lt;/time></pre>

0 comments on commit 00a107c

Please sign in to comment.
You can’t perform that action at this time.