Difference between revisions of "hcalendar-example1-steps"

From Microformats Wiki
hcalendar-example1-steps
Jump to navigation Jump to search
(reflect changes on main hCal page)
(fixes)
Line 25: Line 25:
 
  <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
 
  <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
 
   <span class="summary">Web 2.0 Conference</span>:  
 
   <span class="summary">Web 2.0 Conference</span>:  
   <abbr class="dtstart" title="2007-12-17">October 5</abbr>-
+
   <span class="dtstart">20071017</span>-  
   <abbr class="dtend" title="2007-12-20">19</abbr>,
+
   <span class="dtend">20071019</span>,
 
  at the <span class="location">Argent Hotel, San Francisco, CA</span>
 
  at the <span class="location">Argent Hotel, San Francisco, CA</span>
 
  </div>
 
  </div>
Line 36: Line 36:
 
<span class="url">http://www.web2con.com/</span>&nbsp;<!-- note modified to account for idiosyncrasy of wiki software -->
 
<span class="url">http://www.web2con.com/</span>&nbsp;<!-- note modified to account for idiosyncrasy of wiki software -->
 
<span class="summary">Web 2.0 Conference</span>:  
 
<span class="summary">Web 2.0 Conference</span>:  
<abbr class="dtstart" title="2007-12-17">October 17</abbr>-
+
<span class="dtstart">20071017</span>-  
<abbr class="dtend" title="2007-12-20">19</abbr>,
+
<span class="dtend">20071019</span>,
 
at the <span class="location">Argent Hotel, San Francisco, CA</span>
 
at the <span class="location">Argent Hotel, San Francisco, CA</span>
 
</div>
 
</div>
Line 49: Line 49:
 
Note 3: The version information is unnecessary in hCalendar markup directly since the version will be defined by the profile of hCalendar that is used/referred to in the 'profile' attribute of the <head> element.
 
Note 3: The version information is unnecessary in hCalendar markup directly since the version will be defined by the profile of hCalendar that is used/referred to in the 'profile' attribute of the <head> element.
  
Note 4: ISO8601 dates are however not very human friendly. Not only that, in the case of the end datetime (DTEND), the date must be specified as a whole day after the last day since [http://lists.osafoundation.org/pipermail/ietf-calsify/2005-September/000769.html DTEND is exclusive]! In addition, the year is often understood implicitly by humans from the context. Thus this example could be improved by using &lt;abbr&gt; to make the date information more human readable and friendly, e.g.
+
Note 4: ISO8601 dates are however not very human friendly. Not only that, in the case of the end datetime (DTEND), the date must be specified as a whole day after the last day since [http://lists.osafoundation.org/pipermail/ietf-calsify/2005-September/000769.html DTEND is exclusive]! In addition, the year is often understood implicitly by humans from the context. Thus this example could be improved by using &lt;abbr&gt; to make the date information more human readable and friendly, e.g.
  
 
<pre><nowiki>
 
<pre><nowiki>
 
<span class="vevent">
 
<span class="vevent">
  <a class="url" href="http://www.web2con.com/">
+
  <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
 
   <span class="summary">Web 2.0 Conference</span>:  
 
   <span class="summary">Web 2.0 Conference</span>:  
   <abbr class="dtstart" title="20051005">October 5</abbr>-
+
   <abbr class="dtstart" title="20071017">October 17</abbr>-
   <abbr class="dtend" title="20051008">7</abbr>,
+
   <abbr class="dtend" title="20071020">19</abbr>,
 
  at the <span class="location">Argent Hotel, San Francisco, CA</span>
 
  at the <span class="location">Argent Hotel, San Francisco, CA</span>
</a>
 
 
</span>
 
</span>
 
</nowiki></pre>
 
</nowiki></pre>
Line 64: Line 63:
 
which could be displayed as:
 
which could be displayed as:
  
[http://www.web2con.com/ Web 2.0 Conference: October 5-7, at the Argent Hotel, San Francisco, CA]
+
<div class="vevent">
 
+
<span class="url">http://www.web2con.com/</span>&nbsp;<!-- note modified to account for idiosyncrasy of wiki software -->
 +
<span class="summary">Web 2.0 Conference</span>:  
 +
<abbr class="dtstart" title="20071017">October 17</abbr>-
 +
<abbr class="dtend" title="20071020">19</abbr>,
 +
at the <span class="location">Argent Hotel, San Francisco, CA</span>
 +
</div>
  
 
Back to the [[hcalendar]] specification.
 
Back to the [[hcalendar]] specification.

Revision as of 09:22, 29 March 2007

hCalendar Example 1 Steps

This is a step by step explanation of the first example in the hCalendar specification.

Example

Here is a sample event in an iCalendar:

BEGIN:VCALENDAR
PRODID:-//XYZproduct//EN
VERSION:2.0
BEGIN:VEVENT
URL:http://www.web2con.com/
DTSTART:20071017
DTEND:20071020
SUMMARY:Web 2.0 Conference
LOCATION:Argent Hotel\, San Francisco\, CA
END:VEVENT
END:VCALENDAR

and an equivalent event in hCalendar format with various elements optimized appropriately. See hCalendar Example 1 Steps for the derivation.

<div class="vevent">
 <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
  <span class="summary">Web 2.0 Conference</span>: 
  <span class="dtstart">20071017</span>- 
  <span class="dtend">20071019</span>,
 at the <span class="location">Argent Hotel, San Francisco, CA</span>
 </div>

which could be displayed as:

http://www.web2con.com/  Web 2.0 Conference: 20071017- 20071019, at the Argent Hotel, San Francisco, CA

Note that this is a live hCalendar microformat, which will be found on this page by parsers.

Note 1: The product information is not necessary since hCalendar is an interchange format. When transforming hCalendar back into iCalendar, the transforming engine should add its own product ID.

Note 2: A surrounding element is optional, and can be left out as such. It is optional since the context of a vcalendar is implied when a vevent is encountered. The implied context/scope is that of the document. Authors may explicitly use elements with class="vcalendar" to wrap sets of vevents that all belong to the same calendar, e.g. when publishing multiple calendars on the same page.

Note 3: The version information is unnecessary in hCalendar markup directly since the version will be defined by the profile of hCalendar that is used/referred to in the 'profile' attribute of the <head> element.

Note 4: ISO8601 dates are however not very human friendly. Not only that, in the case of the end datetime (DTEND), the date must be specified as a whole day after the last day since DTEND is exclusive! In addition, the year is often understood implicitly by humans from the context. Thus this example could be improved by using <abbr> to make the date information more human readable and friendly, e.g.

<span class="vevent">
 <a class="url" href="http://www.web2con.com/">http://www.web2con.com/</a>
  <span class="summary">Web 2.0 Conference</span>: 
  <abbr class="dtstart" title="20071017">October 17</abbr>-
  <abbr class="dtend" title="20071020">19</abbr>,
 at the <span class="location">Argent Hotel, San Francisco, CA</span>
</span>

which could be displayed as:

http://www.web2con.com/  Web 2.0 Conference: October 17- 19, at the Argent Hotel, San Francisco, CA

Back to the hCalendar 1.0 specification.