HTML and CSS Reference
In-Depth Information
<time itemprop="openingHours" datetime="Mo-Fr 12:00-22:00">
Mon-Fri: 12:00 - 22:00</time><br>
<time itemprop="openingHours" datetime="Sa,Su 11:00-23:00">
Sat-Sun: 11:00 - 23:00</time>
</p>
</section>
</section>
Now that you are finished with the Locations page, take a look at the rest of the pages on the website. Are there any
other areas of content that you think would benefit from the use of microdata? Try adding microdata to those areas
(you might need to read the rest of this chapter first).
Events
Marking up your events data enables computer programs to use this data for a number of possible applications. For
example, imagine if when you did a web search for an event, the important details about the event appeared right
there in the search results, saving you the job of having to find the correct link in the results and then scan the web
page for details about the event. That could be really useful.
Google already does something similar to this. If you search for your favorite sports team Google will show you a
summary of recent results and upcoming games above the normal search results.
Every October Joe's Pizza Co. runs a number of special events in celebration of national Italian-American heritage
month. In this section you learn how to use microdata to mark up one of these events.
You can define an event by using the Event schema.
<div itemscope itemtype="http://schema.org/Event"></div>
Events have the same four basic properties that all schema.org items have: name , description , image , and
url , plus the properties outlined in the following list.
startDate —Your startDate should be supplied in a machine-readable format. It's usually best to use
a <time> element when specifying dates and times with microdata. Computer programs will use the con-
tents of the datetime attribute. The Joe's Pizza Co. event will start at 9am on Saturday 5th October.
<time itemprop="startDate" datetime="2013-10-05T09:00">
Saturday 5th October at 9am
</time>
Refer to the “Dates and Times” section in Chapter 4 for more information about machine-readable datetime
formats.
endDate —The endDate should follow the same rules as the startDate . The Joe's Pizza Co. event is a
one-day event that finishes at 5:30pm.
<time itemprop="endDate" datetime="2013-10-05T17:30">
Saturday 5th October at 5:30pm
Search WWH ::




Custom Search