xhours: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(Redirecting to more descriptive "operating-hours" page title)
 
(5 intermediate revisions by one other user not shown)
Line 1: Line 1:
<h1>xHours</h1>
#REDIRECT [[operating-hours]]
 
This page documents an effort to define a simple, open, and semantic format for marking up the operating hours of stores, restaurants, museums, offices, and other estabishments that have set hours and are open on a regular basis. xHours is closely based on the [[hCalendar]] microformat.
 
__TOC__
== Draft specification ==
 
=== Editor/Author ===
* [http://dragotown.com Nick Drago]
 
=== Process ===
This document's current status is an "exploratory discussion".
 
Per the microformats [[process]], these sections of this document are in development:
* examples
* formats
* brainstorming
 
Please feel free to help by contributing your thoughts and ideas.
 
== Introduction ==
This effort came about as a result of:
 
* the need for a human and machine readable markup format that can be used to define the operating hours of establishments
* the belief that the hCalendar format is not fully appropriate (not yet capable, etc.) for defining repeating events to the extent needed
 
Stores, businesses, etc. often provide their operating hours on their websites. With the addition of a small bit of markup, they would be able to discuss their operating hours on their websites in such a way that spiders and other aggregators can retrieve such hours, automatically convert them to the iCalendar format, and use this data in any iCalendar application or service.
 
This document proposes the introduction of a format which is a close subset of the [[hCalendar]] microformat, and thus the iCalendar standard, in semantic XHTML. Organizations and businesses can both embed their operating hours directly in their web pages and style them with CSS to make them appear as desired. In addition, this format would enable applications to retrieve such data directly from web pages without having to reference a separate file.
 
== Current example ==
The website of a national chain of retail stores (we'll call them Store XYZ) features a store locater, in which one enters their city and state and are provided with a listing of stores in their area. Below is an excerpt of one of the listings (slightly modified):
<pre>
<b>Store #5555</b><br>
Address, City, State, Zip <br>
<b>Hours:</b> Mon-Sat 10:00am-9:00pm<br>Sun 11:00am-7:00pm
<br><br>
<b>This store also features:</b><br>
- Mobile electronics installation <br>
</pre>
 
== Brainstorming ==
There are several main components to this listing:
* Location
** The establishment name
** The establishment address
* Hours
** Day of week
** Open time
** Close time
 
=== Using iCalendar ===
Using the current iCalendar standard, and using the date conventions defined in [http://en.wikipedia.org/wiki/ISO_8601#Time_interval ISO 8601], Store XYZ's store hours could be expressed as an interval:
<pre>
2007-01-01T10:00:00Z/2007-01-01T21:00:00Z
</pre>
Note that this defines the hours as an event occurring on January 1, 2007 from 10:00a.m. to 9:00p.m. (21:00).
 
Now, to make this event repeat, "R[n]/" is prefixed, with n being defined as 365:
<pre>
R365/2007-01-01T10:00:00Z/2007-01-01T21:00:00Z
</pre>
This would repeat this event 365 times, for the 365 days in a year. However, this is not appropriate, because Store XYZ is open during different hours during different days of the the week.
 
=== Using numbers for the weekday ===
The date could be marked up more simply by using an extension of [http://en.wikipedia.org/wiki/ISO_8601#Check_digit_.28weekday.29 ISO 8601]. ISO 8601 defines [http://en.wikipedia.org/wiki/ISO_8601#Week_dates weekday numbers] as:
<blockquote>
a digit [D] from 1 through 7, beginning with Monday and ending with Sunday
</blockquote>
 
xHours will use the digit (1 through 7, Monday through Sunday) to represent the day of the week.
 
== Format ==
The proposed method of marking up the date and time an establishment is open (using xHours) is the following:
<pre>
DTSTART:1-6-T10:00:00Z //this shows that Store XYZ opens Monday- Saturday (1-6) at 10:00
DTEND:1-6-T21:00:00Z// this shows that Store XYZ closes Monday- Saturday (1-6) at 21:00
</pre>
 
xHours markup (formatted similarly to hCalendar):
 
<pre><nowiki>
<div class="vevent">
<h3 class="summary">Store XYZ #5555</h3>
<p class="description">Store XYZ #5555's Hours</p>
<p>We will be open <abbr class="dtstart" title="1-6-T10:00:00Z">
Monday through Saturday from 10:00AM</abbr> until
<abbr class="dtend" title="1-6-T21:00:00Z">9:00PM</abbr></p>
<p>At our main location: <span class="location">Store #5555 in Anytown, USA</span></p>
</div>
</nowiki></pre>
 
== Problems ==
* How could multiple sets of hours be defined in the same paragraph? e.g. define Monday-Saturday's hours and Sunday's hours in the same vevent
* Are the weekday numbers (1-7) appropriate?
** No, it is not OK because of internationalization. In different cultures the week starts on different days.
**They are defined in ISO 8601, but this is an extension of that format.
 
== References ==
=== Normative References ===
* [http://www.w3.org/TR/2002/REC-xhtml1-20020801/ XHTML 1.0 SE]
* [[hcard]]
* [[hCalendar]]
* [http://www.ietf.org/rfc/rfc2445.txt iCalendar RFC2445]
* [http://www.iso.org/iso/en/prods-services/popstds/datesandtime.html ISO 8601]
 
=== Informative References ===
* [http://en.wikipedia.org/wiki/ISO_8601 Wikipedia article on ISO 8601]

Latest revision as of 22:25, 4 February 2007

Redirect to: