Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Attribute pubdate not allowed on element time at this point

I have a HTML 5 document containing the element:

<time datetime='2013-04-18T12:57:59+01:00' pubdate='pubdate'>Thu, 18 Apr 2013 at 0:57PM</time>

This doesn't validate. The error is 'Attribute pubdate not allowed on element time at this point.'

Any idea how to correct this validation error?

Thanks!

like image 815
stikkos Avatar asked Apr 19 '13 09:04

stikkos


2 Answers

Could be the pubdate attribute is being removed from the specifications. So just don't use pubdate.

like image 196
scootergrisen Avatar answered Nov 27 '22 17:11

scootergrisen


I've made a little research on this subject and it seems that the best way to get around this is to use itemprop="datePublished" attribute.

Check out the code example published at w3.org:

<article itemscope itemtype="http://schema.org/BlogPosting">
  <h1 itemprop="headline">Small tasks</h1>
  <footer>Published <time itemprop="datePublished" datetime="2009-08-30">yesterday</time>.</footer>
  <p itemprop="articleBody">I put a bike bell on his bike.</p>
</article>

Changed my code like that and now validation is passed.

itemprop="published" is also possible when using a fictional microdata vocabulary. Here is the code that validates successfully too:

Posted on <time itemprop="published" datetime="2014-06-24T17:00:00+00:00">June 24, 2014</time>

Note: As xmojmr has commented, itemprop must go with appropriate itemscope itemtype="..." to validate properly.

Reference

  • schema.org/Article
  • schema.org/docs/gs.html#microdata_itemscope_itemtype
  • "Google suggests using microdata" in About rich snippets and structured data
like image 27
Dmytro Dzyubak Avatar answered Nov 27 '22 15:11

Dmytro Dzyubak