Timegrid/Creating Data

From SIMILE Widgets

Timegrid is a tool for visualizing event data, so the first step in creating a Timegrid is creating a file containing event data in a format that Timegrid can understand. Luckily, if you have any event source files for Timeline, Timegrid by default uses both Timeline's XML and JSON formats.

[edit] XML

Here is an example of a Timegrid XML event source file:

<data dateTimeFormat="iso8601">
  <event 
    start="2007-08-29" 
    end="2007-08-30" 
    title="Event #1 Title">
    This event is a simple multi-day event.
  </event>
  <event
    start="2007-09-01T09:00" 
    end="2007-09-01T13:00" 
    title="Event #2 Title">
    This event starts at 9am and ends at 1pm, local time.
  </event>
  <event
    start="2007-09-02T10:00-05:00" 
    end="2007-09-02T12:00-05:00" 
    title="Event #3 Title">
    This event has timezone information provided with the times.
  </event>
</data>

[edit] JSON

Here is an example of a Timegrid JSON event source file:

{
  dateTimeFormat: 'iso8601',
  events: [
    {
      start:       '2007-08-29',
      end:         '2007-08-30',
      title:       'Event #1 Title',
      description: 'This event is a simple multi-day event.'
    },
    {
      start:       '2007-09-01T09:00',
      end:         '2007-09-01T13:00',
      title:       'Event #2 Title',
      description: 'This event starts at 9am and ends at 1pm, local time.'
    },
    {
      start:       '2007-09-02T10:00-05:00',
      end:         '2007-09-02T12:00-05:00',
      title:       'Event #3 Title',
      description: 'This event has timezone information provided with the times.'
    }
  ]
}
Personal tools
TOOLBOX
LANGUAGES