Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 00a107c
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 49 deletions.
61 changes: 46 additions & 15 deletions complete.html
Expand Up @@ -5936,7 +5936,7 @@ <h5 id=time-zones><span class=secno>2.5.5.6 </span>Time zones</h5>
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>
Expand Down Expand Up @@ -6007,26 +6007,45 @@ <h5 id=time-zones><span class=secno>2.5.5.6 </span>Time zones</h5>
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>

Expand Down Expand Up @@ -21171,7 +21190,9 @@ <h4 id=the-time-element><span class=secno>4.6.11 </span>The <dfn><code>time</cod
<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>
Expand All @@ -21184,9 +21205,19 @@ <h4 id=the-time-element><span class=secno>4.6.11 </span>The <dfn><code>time</cod
<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>
Expand Down
61 changes: 46 additions & 15 deletions index
Expand Up @@ -5936,7 +5936,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
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>
Expand Down Expand Up @@ -6007,26 +6007,45 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
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>

Expand Down Expand Up @@ -21171,7 +21190,9 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
<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>
Expand All @@ -21184,9 +21205,19 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
<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>
Expand Down
80 changes: 61 additions & 19 deletions source
Expand Up @@ -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>
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -22660,7 +22690,9 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
<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>
Expand All @@ -22673,9 +22705,19 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
<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>
Expand Down

0 comments on commit 00a107c

Please sign in to comment.