Reputation: 315
I want to use the <time>
tag for the start and end dates of a tour but I can't see how best to code it.
For example the human readable format is "Sun March 6th to Sunday March 13th"
I could simply use two sets of time tags but iirc isn't it possible for the viewer to click a date and add an event directly to their calendar?? If so wouldn't that need to be within the same single <time>
or am I not understanding it correctly?
Duration doesn't do what I want as it only shows the length of the tour not the two dates when it begins and ends and obviously it won't work for adding the event to the viewers calendar.
Upvotes: 0
Views: 919
Reputation: 18870
I would recommend using a mixture of the microdata Event schema and the time
element.
For example:
<article itemscope itemtype="http://schema.org/Event">
<h3 itemprop="name">My Event</h3>
<time itemprop="startDate" datetime="2016-03-06">Sunday, March 6th</time>
<time itemprop="endDate" datetime="2016-03-13">Sunday, March 13th</time>
</article>
If you use this, to be valid, you also need to add a location (the description for which you can find in the link to the Event schema above). You can test the validity using Google's Structured Data Testing Tool.
Upvotes: 1