tonyganch / calendar

Home Page:http://tonyganch.com/calendar

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Calendar

Build Status

This is a simple calendar viewer that loads data from xml.
See demo here: http://tonyganch.com/calendar.

Task

The task is a modification of bin packing problem.
Given a number of events, display them on the grid effectively:

  • events should not overlap;
  • events should take maximum space;
  • minimal time interval is 30 minutes (i.e. event 09:05–09:40 should be displayed as 09:00–10:00).

XML format

The app has no client-side validation so it assumes that xml you're trying to load is valid and follows this format:

<xml>
  <dayinweek hr="30.03.2016 15:07:18">1459350438</dayinweek>
  <items>
    <item>
      <title>Overnight</title>
      <start hr="26.03.2016 02:00:00">1458957600</start>
      <end hr="27.03.2016 06:30:00">1459060200</end>
    </item>
  </items>
</xml>
  • <dayinweek> represents current day;
  • <item> represents event's data.

Note that all dates should be provided in Unix time format.
Also note that hr attribute is optional and the app ignores it.

Build

JS files are build using Browserify.
All output files are located in project root directory to make app work nicely with GitHub pages.

To build app locally:

# Install dev dependencies
npm i
# Build files
npm run build
# Optionally, process js files with uglify
npm run uglify

About

http://tonyganch.com/calendar


Languages

Language:JavaScript 83.3%Language:HTML 10.0%Language:CSS 5.4%Language:Shell 1.4%