xhours: Difference between revisions

From Microformats Wiki
Jump to navigation Jump to search
(now deprecated, instead use RRULE in hCalendar)
m (added another statement)
Line 2: Line 2:


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.
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.
This format is '''deprecated'''. It has been recommended that RRULE in [[hCalendar]] be used instead.


__TOC__
__TOC__
Line 10: Line 12:


=== Process ===
=== Process ===
This format is '''deprecated'''. Please use RRULE in [[hCalendar]] instead.
This format is '''deprecated'''. It has been recommended that RRULE in [[hCalendar]] be used instead.
 
Please feel free to help by contributing your thoughts and ideas.


== Introduction ==
== Introduction ==

Revision as of 19:22, 4 February 2007

xHours

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.

This format is deprecated. It has been recommended that RRULE in hCalendar be used instead.

Draft specification

Editor/Author

Process

This format is deprecated. It has been recommended that RRULE in hCalendar be used instead.

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):

<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>

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 ISO 8601, Store XYZ's store hours could be expressed as an interval:

2007-01-01T10:00:00Z/2007-01-01T21:00:00Z

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:

R365/2007-01-01T10:00:00Z/2007-01-01T21:00:00Z

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.

Solution: using Cron recurring events

Using Cron, if I have a store that is open 9am-5pm M-F and noon to 4:30pm on Saturday, I could write:

<div class="not-vevent">
 We will be <span class="state">open</span> from
 <span class="cron">
     <abbr class="hour" title="090000.000Z:170000.000Z">9am to 5pm</abbr>
     <abbr class="dayofweek"
title="Monday,Tuesday,Wednesday,Thursday,Friday">M-F</abbr>
 </span>
  and
 <span class="cron">
     <abbr class="hour" title="1200Z:1630Z">noon to 4:30</abbr>
     <abbr class="dayofweek"
title="Monday,Tuesday,Wednesday,Thursday,Friday">Saturday</abbr>
 </span>
</div>

Essentially, state holds when any of the cron clauses matches. A colon indicates a range and a comma indicates junction. Some classes (year,month,day,hour, minute, second, etc.) would specify the maximum resolution, i.e. what the largest digits mean; e.g. every 30 minutes as opposed to every 30 seconds.

Problems

  • Are the weekday numbers (1-7) appropriate?
    • No, it is not OK because of internationalization. In different cultures the week starts on different days.

References

Normative References

Informative References