h-event parsing tests

This page was design to test the parsing of h-event. These tests are part of the micorformats 2 test suite.

Just a name (h-event parsing test)

IndieWebCamp 2012

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["IndieWebCamp 2012"] 
        }
    }]
}

Just a hyperlink (h-event parsing test)

IndieWebCamp 2012

The expected JSON output:


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

h-event with attendees (h-event 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 (h-event 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/"],
                    "street-address": ["920 SW 3rd Ave. Suite 400"],
                    "locality": ["Portland"],
                    "region": ["Oregon"]
                }
            }]
        }
    },{
        "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 (h-event 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 (h-event 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",
                "2013-06-27 15:34:00"
            ]
        }
    }]
}

Meridiem time formats (am pm) (h-event 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"
            ]
        }
    }]
}

dt-property (h-event parsing test)

The party will be on

March 14th 2013

, from 07:00:00am

Just added, Removed

June 29

2013-07-02

The expected JSON output:


{
    "items": [{ 
        "type": ["h-event"],
        "properties": {
            "name": ["The party"],
            "start": [
                "2013-03-14",
                "2013-06-25T07:00:00",
                "2013-06-26",
                "2013-06-27",
                "2013-06-28",
                "2013-06-29",
                "2013-07-01",
                "2013-07-02"
            ]
        }
    }]
}

Note: This test the parse order of elements and attributes as laid out in http://microformats.org/wiki/microformats2-parsing wiki page.

Change log:

Contributors :