hcalendar parsing tests

This page was design to test the parsing of hcalendar and its output to the newer JSON structure of micorformats 2. These tests are part of the micorformats 2 test suite.

Theses are backwards compatibility tests for the older version 1 microformats specification. Please do not use this as a reference for authoring microformats.

Just a name (hcalendar parsing test)

IndieWebCamp 2012

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["IndieWebCamp 2012"],
            "url": ["http://indiewebcamp.com/2012"]
        }
    }]
}

Just a hyperlink (hcalendar parsing test)

IndieWebCamp 2012

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["IndieWebCamp 2012"],
            "url": ["http://indiewebcamp.com/2012"]
        }
    }]
}

hcalendar with attendees (hcalendar parsing test)

CPJ Online Press Freedom Summit () in San Francisco. Attendees:
  • Brian Warner
  • Kyle Machulis
  • Tantek Çelik
  • Sid Sutter

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["CPJ Online Press Freedom Summit"],
            "start": ["2012-10-10"],
            "location": ["San Francisco"],
            "attendee": [{
                "value": "Brian Warner",
                "type": ["h-card"],
                "properties": {
                    "name": ["Brian Warner"]
                }
            },{
                "value": "Kyle Machulis",
                "type": ["h-card"],
                "properties": {
                    "name": ["Kyle Machulis"]
                }
            },{
                "value": "Tantek Çelik",
                "type": ["h-card"],
                "properties": {
                    "name": ["Tantek Çelik"]
                }
            },{
                "value": "Sid Sutter",
                "type": ["h-card"],
                "properties": {
                    "name": ["Sid Sutter"]
                }
            }]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Brian Warner"]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Kyle Machulis"]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Tantek Çelik"]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Sid Sutter"]
        }
    }]
}

Event with location (hcalendar parsing test)

IndieWebCamp 2012 from to at Geoloqi, 920 SW 3rd Ave. Suite 400, Portland, OR

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["IndieWebCamp 2012"],
            "url": ["http://indiewebcamp.com/2012"],
            "start": ["2012-06-30"],
            "end": ["2012-07-01"],
            "location": [{
                "value": "Geoloqi, 920 SW 3rd Ave. Suite 400, Portland, OR",
                "type": ["h-card"],
                "properties": {
                    "name": ["Geoloqi"],
                    "org": ["Geoloqi"],
                    "url": ["http://geoloqi.com/"],
                    "adr": [{
                        "value": "920 SW 3rd Ave. Suite 400, Portland, OR",
                        "type": ["h-adr"],
                        "properties": {
                            "street-address": ["920 SW 3rd Ave. Suite 400"],
                            "locality": ["Portland"],
                            "region": ["Oregon"],
                            "name": ["920 SW 3rd Ave. Suite 400, Portland, OR"]
                        }
                    }]
                }
            }]
        }
    },{
        "type": ["h-card"],
        "properties": {
            "name": ["Geoloqi"],
            "org": ["Geoloqi"],
            "url": ["http://geoloqi.com/"],
            "street-address": ["920 SW 3rd Ave. Suite 400"],
            "locality": ["Portland"],
            "region": ["Oregon"]
        }
    }]
}

Concatenate multiple datetime elements (hcalendar parsing test)

The 4th Microformat party will be on , from to .

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["The 4th Microformat party"],
            "start": ["2009-06-26T19:00:00"],
            "end": ["2009-06-26T22:00:00"]
        }
    }]
}

Time formats (hcalendar parsing test)

The 4th Microformat party will be on
  • , from
  • , from
  • , from
  • , from
  • , from
  • , from
  • , from
  • , from
  • , from

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["The 4th Microformat party"],
            "start": [
                "2009-06-26T19:00:00-0800",
                "2009-06-26T19:00:00-0800",
                "2009-06-26T19:00:00+0800",
                "2009-06-26T19:00:00Z",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00-0800",
                "2009-06-26T19:00:00+0800",
                "2009-06-26T19:00:00Z",
                "2009-06-26T19:00:00"
            ],
            "end": ["2013-034"]
        }
    }]
}

Meridiem time formats (am pm) (hcalendar parsing test)

The 4th Microformat party will be on
  • , from 07:00:00pm
  • , from 07:00:00am
  • , from 07:00pm
  • , from 07pm
  • , from 7pm
  • , from 7:00pm
  • , from 07:00p.m.
  • , from 07:00PM
  • , from 7:00am

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["The 4th Microformat party"],
            "start": [
                "2009-06-26T19:00:00",
                "2009-06-26T07:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T19:00:00",
                "2009-06-26T07:00:00"
            ]
        }
    }]
}

Change log:

Contributors:

The orginal test also had contributions from: