-
Notifications
You must be signed in to change notification settings - Fork 4
/
390.txt
212 lines (158 loc) · 11.4 KB
/
390.txt
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
[4] [[HTML]] の [DFN[[CODE(HTMLe)@en[time]] [[要素]]]]は、[[日時]]や[[日付]]や[[時刻]]を表します。
* 歴史
** 前史
[1] [[日時]]を [[HTML]] で記述する手法は古くから要求があり、[[要素]]を新たに追加するもの、
既存の[[要素]]を流用するものなど、様々な提案がありました。
*** 新しい要素の提案
[2]
[CITE[Aural Cascading Style Sheets (ACSS)]] <http://www.w3.org/TR/WD-acss-970630#speech-properties>
> This [INS[('[CODE(CSS)@en[[[speak-date]]]]' property)]] would be most useful when combined with
a new HTML tag used to identify dates, such as this theoretical example:
[PRE(HTML example code)[
<p>The campaign started on <date value="1874-oct-21">
the twenty-first of that month</date> and finished
<date value="1874-oct-28">a week later</date>
]PRE]
[16]
[CITE@en[W3C I18N FAQ: Date formats]] ([TIME[2007-05-20 22:36:46 +09:00]] 版) <http://www.w3.org/International/questions/qa-date-format#bytheway>
>
Some have advocated the creation of a <date> tag that would display dates according the locale of the user agent. This is subject to the same practical issues as described for dynamic date generation with the Japanese example. The appropriate format is generally a function of the linguistic context of a page, rather than the user's platform.
*** 既存要素の流用
[63] [[マイクロフォーマット]]界隈では、 [CODE(HTMLe)@en[[[abbr]]]] [[要素]]を[[日時]]の表記に流用する
「[[デザイン・パターン]]」を発明しました。 (詳しくは [CODE(HTMLe)@en[[[abbr]]]]
の項を参照してください。)
[62] [CITE@en-us[Tantek's Thoughts]] ([[Tantek Çelik]] 著, [TIME[2006-05-20 00:13:35 +09:00]] 版) <http://tantek.com/log/2005/01.html#d26t0100>
>
My first instinct was to try the <object> tag, since it has a nice mechanism for providing data within its 'data' attribute, and fallback plain text inside the element itself, e.g. (simplified for sake of discussion):
[PRE(HTML example code)[
<object data="20050125">January 25</object>
]PRE]
This worked great in typical modern browsers, except for one: Safari (v1.2.1). Unfortunately, to put it mildly, Safari's <object> support sucks. It doesn't handle <object> fallbacks, it doesn't know when not to handle <object> mime types that it doesn't support, it doesn't support display:inline on <object>, and it doesn't do proper intrinsic sizing of <object> replaced elements. These are all trivial to reproduce bugs.
>Humans don't think of dates and times in terms of fully qualified year, month, date, hour, minute, second, time-zone values. Humans think of dates and times in terms of only that which is necessary. The day, or the day and the month, or perhaps just the hour. What do all these have in common? They are all abbreviations for a fully qualified date and time.
>
Lucky for us, XHTML has an element for abbreviations: <abbr>.
>
Thus, the ISO8601 date 20050125 should be marked up as:
[PRE(HTML example code)[
<abbr title="20050125">January 25th</abbr>
]PRE]
[64] しかしこれに対しては「[CODE(HTMLe)@en[[[abbr]]]] は[[略語]]を表すが、[[日時]]は[[略語]]ではない」
などの批判があり、[[マイクロフォーマット]]界隈を越えて普及するには至りませんでした。
** HTML5
@@ 最初は [CODE(HTML)@en[[[date]]]] だった。
*** [CODE(HTMLe)@en[t]] 要素
[3]
[[Ian Hickson]] は、[[日時]]を表す[[要素]]の追加の要求が古くから強いことを踏まえ、
[CODE(HTMLe)@en[[[t]]]] [[要素]]を [[HTML5]] 仕様案に追加しました。
[5]
現地時間が記述されていても、 tooltip で利用者の地方時が表示されるようなブラウザにwktk
([[名無しさん]] [WEAK[2006-09-25 23:41:07 +00:00]])
[6]
[CITE[[whatwg] Joe Clark's Criticisms of the WHATWG and HTML 5]] <http://listserver.dreamhost.com/pipermail/whatwg-whatwg.org/2006-October/007513.html>
([[名無しさん]] [WEAK[2006-10-31 00:54:15 +00:00]])
[7] >>6
[CITE['''['''whatwg''']''' Joe Clark's Criticisms of the WHATWG and HTML 5]] ([TIME[2009-03-09 12:00:26 +09:00]] 版、
[[Ian Hickson]] 著) <http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2006-October/007513.html>
><t> (or an equivalent) has been widely requested, especially in the
microformats and CSS communities. Several microformats have need for
encoding specific times and/or dates, and are currently (ab?)using <abbr>
for this purpose. The CSS community has requested a <date> or <time>
element because they want to restyle dates and times according to locale.
The blogging and content publishing communities have also raised the need
for a way to unambiguously mark up what part of their document is a date
and/or time, though in their case (as with microformats) they need a way
to then mark each date/time element as being a particular semantic
(publishing date, birth date, calendar event time etc).
>
Also, the aforementioned research indicated that there are substantial
amounts of content on the Web that uses invented elements, IDs, and class
attributes to mark up dates and times. For example, I found about the same
number of pages with the obscure ID "updatedtime" as I did pages with a
<button> element; "date" was the 14th most frequently seen class name.
*** [CODE(HTMLe)@en[time]] 要素
[8] 「[CODE(HTMLe)@en[[[t]]]]」は短すぎるということで、後に [CODE(HTMLe)@en[[[time]]]]
に改められました。
[17]
[CITE[Sam Ruby: The <time> element]] ([TIME[2007-04-19 08:32:25 +09:00]] 版) <http://www.intertwingly.net/blog/2007/04/17/The-time-element>
([[名無しさん]] [WEAK[2007-04-18 23:39:35 +00:00]])
* 実装
[61] [CODE(HTMLe)@en[[[time]]]] [[要素]]を[[利用者]]の[[時間帯]]・[[ロケール]]の文字列として[[レンダリング]]する[[スクリプト]]。
「○分前」みたいな表示もできます。
<http://suika.fam.cx/www/style/ui/time.js.u8>
* 関連
[65] [CODE(HTMLe)@en[[[time]]]] [[要素]]以前にも [[HTML]] には [CODE(HTMLe)@en[[[ins]]]]
[[要素]]と [CODE(HTMLe)@en[[[del]]]] [[要素]]に [CODE(HTMLa)@en[[[datetime]]]]
[[属性]]があり、編集の日時を表記するためにはこれが用いられていました。 [[CSS]]
によって [CODE(HTMLa)@en[[[datetime]]]] [[属性]]を[[レンダリング]]させている人もいました。
[9] [CODE(HTMLe)@en[[[time]]]] [[要素]]は[[文書]]中の[[日時]]を[[マーク付け]]するものですが、
[[フォーム]]において[[利用者]]に[[日時]]を入力させるものとしては
[CODE(HTML)@en[[[<input type=datetime>]]]]、
[CODE(HTML)@en[[[<input type=datetime-local>]]]]、
[CODE(HTML)@en[[[<input type=date>]]]]、
[CODE(HTML)@en[[[<input type=time>]]]] があります。
[10] [[文書]]の[[作成日時]]や[[変更日時]]を [[Dublin Core]] を用いて
[CODE(HTMLe)@en[[[meta]]]] [[要素]]に記述する人達もいました。
* メモ
[76] [CITE[''''''[''''''whatwg'''''']'''''' <time> element feedback]]
( ([TIME[2010-12-08 08:42:59 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-December/029363.html>
[67] [CITE[''''''[''''''whatwg'''''']'''''' proposal: extend <time> to markup durations]]
( ([TIME[2011-07-30 04:20:12 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-July/032456.html>
[69] [CITE@en[Web Applications 1.0 r6783 Drop <time> and replace it with <data>. Drop the Atom conversion section entirely. Convert a bunch of examples that used to use <time pubdate> to using schema.org, to show how to annotate publication dates and the like in a machine-processable way.]]
( ([TIME[2011-10-29 14:38:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6782&to=6783>
[70] [CITE[IRC logs: freenode / #whatwg / 20111102]]
( ([TIME[2011-11-05 12:41:15 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111102>
[71] [CITE[IRC logs: freenode / #whatwg / 20111102]]
( ([TIME[2011-11-05 12:41:15 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111102>
[72] [CITE@en[HTML5 spec reverted to cvs r1.5431, svn r6782 ''''''[''''''was: Revert request for r6783'''''']'''''']]
( ([[Michael'''['''tm''']''' Smith]] 著, [TIME[2011-11-11 03:06:27 +09:00]] 版))
<http://lists.w3.org/Archives/Public/public-html/2011Nov/0098.html>
[73] [CITE[IRC logs: freenode / #whatwg / 20111110]]
( ([TIME[2011-11-12 00:39:03 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111110>
[74] [CITE[IRC logs: freenode / #whatwg / 20111111]]
( ([TIME[2011-11-12 00:43:00 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111111>
[75] [CITE@en[Ian Hickson responds over HTML5 getting 'time' element back | News | .net magazine]] ([TIME[2011-11-12 01:05:16 +09:00]] 版) <http://www.netmagazine.com/news/ian-hickson-responds-over-html5-getting-time-element-back-111552>
[77] [CITE@en[Time element - WHATWG Wiki]]
( ([TIME[2011-11-06 10:06:26 +09:00]] 版))
<http://wiki.whatwg.org/wiki/Time_element>
[78] [CITE@en[Web Applications 1.0 r6827 the <time> element is dead, long live the <time> element]]
( ([TIME[2011-11-19 04:43:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6826&to=6827>
[79] [CITE@en[Web Applications 1.0 r6829 extend timezone format to also allow omitting the colon]]
( ([TIME[2011-11-19 08:22:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6828&to=6829>
[80] [CITE@en[(3) Google]]
( ([TIME[2011-11-19 13:57:07 +09:00]] 版))
<https://plus.google.com/107429617152575897589/posts/3ZEQAVkF6xd>
[81] [CITE[IRC logs: freenode / #whatwg / 20111116]]
( ([TIME[2011-11-18 00:23:14 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111116>
[82] [CITE[IRC logs: freenode / #whatwg / 20111118]]
( ([TIME[2011-11-20 12:06:23 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111118>
[83] [CITE[IRC logs: freenode / #whatwg / 20111129]]
( ([TIME[2011-11-29 08:57:16 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111129>
[84] [CITE[IRC logs: freenode / #whatwg / 20111206]]
( ([TIME[2011-12-07 08:32:57 +09:00]] 版))
<http://krijnhoetmer.nl/irc-logs/whatwg/20111206#l-1112>
[85] [CITE['''['''whatwg''']''' proposal: extend <time> to markup durations]]
([TIME[2011-12-07 09:36:37 +09:00]] 版)
<http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-December/034091.html>
[86] [CITE@en[Web Applications 1.0 r6845 Update the date-and-time microsyntaxes to support having the 'T' replaced by a single space. (Note: multiple spaces are invalid and will cause parse failures. Only a single space is supported.) Based on proposal and implementation evidence from Tantek documented at http://wiki.whatwg.org/wiki/Time_element#permit_space_instead_of_T_in_datetimesAffected topics: HTML, Microdata]]
( ([TIME[2011-12-07 08:00:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=6844&to=6845>
[87] [CITE[''''''[''''''whatwg'''''']'''''' proposal: extend <time> to markup durations]]
( ([TIME[2011-12-09 08:14:18 +09:00]] 版))
<http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-December/034091.html>
[88] [CITE@en[Web Applications 1.0 r7435 Make the year-only format for <time> more in line with how it works elsewhere.]]
( ([TIME[2012-10-06 07:50:00 +09:00]] 版))
<http://html5.org/tools/web-apps-tracker?from=7434&to=7435>
[89] [[HTML+RDFa 1.1]] は [CODE(HTMLe)@en[[[time]]]] [[要素]]の独自の解釈を規定しています。
([[RDFa処理器]]の項を参照。)