Skip to content

Commit

Permalink
[] (0) Make <time> have just a .valueAsDate attribute instead of .dat…
Browse files Browse the repository at this point in the history
…e/.time/.timezone, since people prefer just one attribute.

git-svn-id: http://svn.whatwg.org/webapps@3750 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Sep 4, 2009
1 parent 922eec7 commit 3ed5ad4
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 127 deletions.
94 changes: 33 additions & 61 deletions index
Original file line number Diff line number Diff line change
Expand Up @@ -15468,9 +15468,7 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
<pre class=idl>interface <dfn id=htmltimeelement>HTMLTimeElement</dfn> : <a href=#htmlelement>HTMLElement</a> {
attribute DOMString <a href=#dom-time-datetime title=dom-time-datetime>dateTime</a>;
attribute boolean <a href=#dom-time-pubdate title=dom-time-pubDate>pubDate</a>;
readonly attribute <span>Date</span> <a href=#dom-time-date title=dom-time-date>date</a>;
readonly attribute <span>Date</span> <a href=#dom-time-time title=dom-time-time>time</a>;
readonly attribute <span>Date</span> <a href=#dom-time-timezone title=dom-time-timezone>timezone</a>;
readonly attribute <span>Date</span> <a href=#dom-time-valueasdate title=dom-time-valueAsDate>valueAsDate</a>;
};</pre>
</dd>
</dl><p>The <code><a href=#the-time-element>time</a></code> element <a href=#represents>represents</a> either a
Expand Down Expand Up @@ -15623,61 +15621,46 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the

</ol></div>

<dl class=domintro><dt><var title="">time</var> . <code title=dom-time-date><a href=#dom-time-date>date</a></code></dt>
<dl class=domintro><dt><var title="">time</var> . <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code></dt>

<dd>

<p>Returns a <code>Date</code> object representing the date
component of the element's value, at midnight in the UTC
time zone.</p>

<p>Returns null if there is no date.</p>
<p>Returns a <code>Date</code> object representing the specified date and time.</p>

</dd>

<dt><var title="">time</var> . <code title=dom-time-time><a href=#dom-time-time>time</a></code></dt>
</dl><div>

<dd>
<p>The <dfn id=dom-time-valueasdate title=dom-time-valueAsDate><code>valueAsDate</code></dfn> IDL
attribute must return either null or a <code>Date</code> object
initialised to the relevant value as defined by the following
list:</p>

<p>Returns a <code>Date</code> object representing the time
component of the element's value, on 1970-01-01 in the UTC
time zone.</p>
<dl><dt>If the <a href=#concept-time-date title=concept-time-date>date</a> is known but
the <a href=#concept-time-time title=concept-time-time>time</a> is not</dt>

<p>Returns null if there is no time.</p>
<dd>The time corresponding to midnight UTC (i.e. the first second)
of the given <a href=#concept-time-date title=concept-time-date>date</a>.</dd>

</dd>
<dt>If the <a href=#concept-time-time title=concept-time-time>time</a> is known but
the <a href=#concept-time-date title=concept-time-date>date</a> is not</dt>

<dt><var title="">time</var> . <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code></dt>
<dd>The time corresponding to the given <a href=#concept-time-time title=concept-time-time>time</a> of 1970-01-01, with the time
zone UTC.</dd>

<dd>

<p>Returns a <code>Date</code> object representing the time
corresponding to 1970-01-01 00:00 UTC in the time zone given by the
element's value.</p>
<dt>If both the <a href=#concept-time-date title=concept-time-date>date</a> and the
<a href=#concept-time-time title=concept-time-time>time</a> are known</dt>

<p>Returns null if there is no time zone.</p>
<dd>The time corresponding to the <a href=#concept-time-date title=concept-time-date>date</a> and <a href=#concept-time-time title=concept-time-time>time</a>, with the given <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a>.

</dd>
<dt>If neither the <a href=#concept-time-date title=concept-time-date>date</a> nor
the <a href=#concept-time-time title=concept-time-time>time</a> are known</dt>

</dl><div>
<dd>The null value.</dd>

<p>The <dfn id=dom-time-date title=dom-time-date><code>date</code></dfn> IDL
attribute must return null if the <a href=#concept-time-date title=concept-time-date>date</a> is unknown, and otherwise must
return the time corresponding to midnight UTC (i.e. the first
second) of the given <a href=#concept-time-date title=concept-time-date>date</a>.</p>

<p>The <dfn id=dom-time-time title=dom-time-time><code>time</code></dfn> IDL attribute
must return null if the <a href=#concept-time-time title=concept-time-time>time</a> is
unknown, and otherwise must return the time corresponding to the
given <a href=#concept-time-time title=concept-time-time>time</a> of 1970-01-01, with
the time zone UTC.</p>

<p>The <dfn id=dom-time-timezone title=dom-time-timezone><code>timezone</code></dfn>
IDL attribute must return null if the <a href=#concept-time-timezone title=concept-time-timezone>time-zone offset</a> is unknown,
and otherwise must return the time corresponding to 1970-01-01 00:00
UTC in the given <a href=#concept-time-timezone title=concept-time-timezone>time-zone
offset</a>, with the time zone set to UTC (i.e. the time
corresponding to 1970-01-01 at 00:00 UTC plus the offset).</p>
</dl><p>The same <code>Date</code> object must be returned until the
<code title=attr-time-datetime><a href=#attr-time-datetime>datetime</a></code> attribute is
removed or changed.</p>

</div>

Expand All @@ -15687,32 +15670,21 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the

<pre>&lt;p&gt;Our first date was &lt;time datetime="2006-09-23"&gt;a Saturday&lt;/time&gt;.&lt;/p&gt;</pre>

<p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value
1,158,969,600,000ms, and the <code title=dom-time-time><a href=#dom-time-time>time</a></code>
and <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attributes would
return null.</p>


<p>In the following snippet:</p>
<p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code> attribute would
have the value 1,158,969,600,000ms.</p>

<pre>&lt;p&gt;We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00"&gt;5am the next morning&lt;/time&gt;.&lt;/p&gt;</pre>
</div>

<p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value
1,159,056,000,000ms, the <code title=dom-time-time><a href=#dom-time-time>time</a></code>
attribute would have the value 18,000,000ms, and the <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attribute would return
&minus;25,200,000ms. To obtain the actual time, the three attributes can
be added together, obtaining 1,159,048,800,000, which is the
specified date and time in UTC.</p>
<!-- <pre>&lt;p>We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00">5am the next morning&lt;/time>.&lt;/p></pre> -->

<div class=example>

<p>Finally, in the following snippet:</p>
<p>In the following snippet:</p>

<pre>&lt;p&gt;Many people get up at &lt;time&gt;08:00&lt;/time&gt;.&lt;/p&gt;</pre>

<p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-date><a href=#dom-time-date>date</a></code> attribute would have the value null,
the <code title=dom-time-time><a href=#dom-time-time>time</a></code> attribute would have the
value 28,800,000ms, and the <code title=dom-time-timezone><a href=#dom-time-timezone>timezone</a></code> attribute would return
null.</p>
<p>...the <code><a href=#the-time-element>time</a></code> element's <code title=dom-time-valueAsDate><a href=#dom-time-valueasdate>valueAsDate</a></code> attribute would
have the value 28,800,000ms.</p>

</div>

Expand Down
107 changes: 41 additions & 66 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -16566,9 +16566,7 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
<pre class="idl">interface <dfn>HTMLTimeElement</dfn> : <span>HTMLElement</span> {
attribute DOMString <span title="dom-time-datetime">dateTime</span>;
attribute boolean <span title="dom-time-pubDate">pubDate</span>;
readonly attribute <span>Date</span> <span title="dom-time-date">date</span>;
readonly attribute <span>Date</span> <span title="dom-time-time">time</span>;
readonly attribute <span>Date</span> <span title="dom-time-timezone">timezone</span>;
readonly attribute <span>Date</span> <span title="dom-time-valueAsDate">valueAsDate</span>;
};</pre>
</dd>
</dl>
Expand Down Expand Up @@ -16746,66 +16744,57 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the

<dl class="domintro">

<dt><var title="">time</var> . <code title="dom-time-date">date</code></dt>
<dt><var title="">time</var> . <code title="dom-time-valueAsDate">valueAsDate</code></dt>

<dd>

<p>Returns a <code>Date</code> object representing the date
component of the element's value, at midnight in the UTC
time zone.</p>

<p>Returns null if there is no date.</p>
<p>Returns a <code>Date</code> object representing the specified date and time.</p>

</dd>

<dt><var title="">time</var> . <code title="dom-time-time">time</code></dt>
</dl>

<dd>
<div>

<p>Returns a <code>Date</code> object representing the time
component of the element's value, on 1970-01-01 in the UTC
time zone.</p>
<p>The <dfn
title="dom-time-valueAsDate"><code>valueAsDate</code></dfn> IDL
attribute must return either null or a <code>Date</code> object
initialised to the relevant value as defined by the following
list:</p>

<p>Returns null if there is no time.</p>
<dl>

</dd>
<dt>If the <span title="concept-time-date">date</span> is known but
the <span title="concept-time-time">time</span> is not</dt>

<dt><var title="">time</var> . <code title="dom-time-timezone">timezone</code></dt>
<dd>The time corresponding to midnight UTC (i.e. the first second)
of the given <span title="concept-time-date">date</span>.</dd>

<dd>
<dt>If the <span title="concept-time-time">time</span> is known but
the <span title="concept-time-date">date</span> is not</dt>

<p>Returns a <code>Date</code> object representing the time
corresponding to 1970-01-01 00:00 UTC in the time zone given by the
element's value.</p>
<dd>The time corresponding to the given <span
title="concept-time-time">time</span> of 1970-01-01, with the time
zone UTC.</dd>

<p>Returns null if there is no time zone.</p>
<dt>If both the <span title="concept-time-date">date</span> and the
<span title="concept-time-time">time</span> are known</dt>

</dd>
<dd>The time corresponding to the <span
title="concept-time-date">date</span> and <span
title="concept-time-time">time</span>, with the given <span
title="concept-time-timezone">time-zone offset</span>.</p>

</dl>
<dt>If neither the <span title="concept-time-date">date</span> nor
the <span title="concept-time-time">time</span> are known</dt>

<div>

<p>The <dfn title="dom-time-date"><code>date</code></dfn> IDL
attribute must return null if the <span
title="concept-time-date">date</span> is unknown, and otherwise must
return the time corresponding to midnight UTC (i.e. the first
second) of the given <span
title="concept-time-date">date</span>.</p>
<dd>The null value.</dd>

<p>The <dfn title="dom-time-time"><code>time</code></dfn> IDL attribute
must return null if the <span title="concept-time-time">time</span> is
unknown, and otherwise must return the time corresponding to the
given <span title="concept-time-time">time</span> of 1970-01-01, with
the time zone UTC.</p>
</dl>

<p>The <dfn title="dom-time-timezone"><code>timezone</code></dfn>
IDL attribute must return null if the <span
title="concept-time-timezone">time-zone offset</span> is unknown,
and otherwise must return the time corresponding to 1970-01-01 00:00
UTC in the given <span title="concept-time-timezone">time-zone
offset</span>, with the time zone set to UTC (i.e. the time
corresponding to 1970-01-01 at 00:00 UTC plus the offset).</p>
<p>The same <code>Date</code> object must be returned until the
<code title="attr-time-datetime">datetime</code> attribute is
removed or changed.</p>

</div>

Expand All @@ -16816,36 +16805,22 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
<pre>&lt;p>Our first date was &lt;time datetime="2006-09-23">a Saturday&lt;/time>.&lt;/p></pre>

<p>...the <code>time</code> element's <code
title="dom-time-date">date</code> attribute would have the value
1,158,969,600,000ms, and the <code title="dom-time-time">time</code>
and <code title="dom-time-timezone">timezone</code> attributes would
return null.</p>


<p>In the following snippet:</p>
title="dom-time-valueAsDate">valueAsDate</code> attribute would
have the value 1,158,969,600,000ms.</p>

<pre>&lt;p>We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00">5am the next morning&lt;/time>.&lt;/p></pre>
</div>

<p>...the <code>time</code> element's <code
title="dom-time-date">date</code> attribute would have the value
1,159,056,000,000ms, the <code title="dom-time-time">time</code>
attribute would have the value 18,000,000ms, and the <code
title="dom-time-timezone">timezone</code> attribute would return
&#x2212;25,200,000ms. To obtain the actual time, the three attributes can
be added together, obtaining 1,159,048,800,000, which is the
specified date and time in UTC.</p>
<!-- <pre>&lt;p>We stopped talking at &lt;time datetime="2006-09-24T05:00-07:00">5am the next morning&lt;/time>.&lt;/p></pre> -->

<div class="example">

<p>Finally, in the following snippet:</p>
<p>In the following snippet:</p>

<pre>&lt;p>Many people get up at &lt;time>08:00&lt;/time>.&lt;/p></pre>

<p>...the <code>time</code> element's <code
title="dom-time-date">date</code> attribute would have the value null,
the <code title="dom-time-time">time</code> attribute would have the
value 28,800,000ms, and the <code
title="dom-time-timezone">timezone</code> attribute would return
null.</p>
title="dom-time-valueAsDate">valueAsDate</code> attribute would
have the value 28,800,000ms.</p>

</div>

Expand Down

0 comments on commit 3ed5ad4

Please sign in to comment.