Code Monkey home page Code Monkey logo

calendar-view's Introduction

Calendar Day View

Pulls Data from link and formats on a daily view agenda

The LayOutDay function that takes in the JSON object and returns a object with the way it should be formatted returns the start, end, width, height, top, and left to make printing to the screen as seamless as possible. First, it loops through all minutes of the day and all events to determine overlapping events and tracks all overlapping events in the concurrentEvents array and tracks the highest number of concurrent events in the maxConcurrent array. This only tracks the maximum for each event and without further processing, all events at any given time may not be the same width, so it loops through all events twice to make sure to update all events if it only loops once, the first few events don't get updated with the later updates. Finally, it loops through all events to set the height, width, and left values to be printed to the printed to the screen. All size values are converted from raw pixel values to values relative to the viewport to allow rendering at all screen size/zoom values.

To view the final result open index.html index.html. You will need internet access to reach the JSON, or the link can be changed on the first line of /js/index.js.

Demo layout The times in the gist don't quite line up with the times provided in the JSON

Not sure if

not sure if

calendar-view's People

Contributors

kevindavus avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.