React: 'datetime' attribute of <time> element is disallowed by react

Created on 27 Jun 2014  Â·  2Comments  Â·  Source: facebook/react

This is how you render a time element (see: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time):

<time datetime="2001-05-15 19:00">May 15</time>

but react throws away the 'datetime' attribute if you do:

React.DOM.time({datetime: "2001-05-15 19:00"}, "may 15")

That is bad because screenreaders/microformats use it to get semantic meaning from it.

see http://jsfiddle.net/VkebS/433/

Most helpful comment

You should use dateTime, DOM properties are camelCased in React. Also see console, it warns you with:

Warning: Unknown DOM property datetime. Did you mean dateTime? 

All 2 comments

You should use dateTime, DOM properties are camelCased in React. Also see console, it warns you with:

Warning: Unknown DOM property datetime. Did you mean dateTime? 

Oh, duh. thank you
On Jun 27, 2014 1:57 AM, "Andrey Popp" [email protected] wrote:

You should use dateTime, DOM properties are camelCased in React. Also see
console, it warns you with:

Warning: Unknown DOM property datetime. Did you mean dateTime?

—
Reply to this email directly or view it on GitHub
https://github.com/facebook/react/issues/1749#issuecomment-47317327.

Was this page helpful?
0 / 5 - 0 ratings