GithubHelp home page GithubHelp logo

jpbrickhouse / work-day-scheduler Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 167 KB

A simple calendar application, allowing the user to save events to localStorage. Based on time of day, the calendar dynamically updates styles and formatting.

Home Page: https://jpbrickhouse.github.io/Work-Day-Scheduler/

HTML 34.70% CSS 8.47% JavaScript 56.83%
calendar-events localstorage javascript

work-day-scheduler's Introduction

Work-Day-Scheduler

Introduction

We were tasked with creating a simple calendar application that allows the user to save events for each hour of the day. The events would be saved to localStorage and would persist even if the page was refreshed or exited. As well, based on the time of the day, the calendar would dynamically update styles and formatting.

Deployed Application:

Screenshot:

Schedule Calendar Visual

Overall Notes

Starter code was provided for the index.html and style.css files. No code was provided for the script.js file.

index.html

Several divs have been introduced to organize and group content:

  • All of these utilize Bootstrap to enable responsive design functionality.
  • Each row corresponds to a block of time (9am, 10am, etc.), has a column diplaying the time, a column displaying a textarea with user-input calendar events, and a column with a save button.
  • All of the textareas have ids (09text, 10text, etc).
  • All of the save buttons have ids (09, 10, etc).
  • These ids are utilized by the javascript file to present and update content

style.css

The majority of the style.css code was provided to us, and only nominal edits were made to refine the visual styles and formatting.

script.js

The bulk of the content for this application can be found in the script.js file. This is written in primarily "vanilla" javascript, but also syntax sourced from the jQuery CDN Library and the Moment.js CDN Library. Numerous functions, event listeners, buttons, etc. have all been generated in order to ensure the functionality of the daily calendar. These items include, but are not limited to, the following:

  • update() - This function utilizes the Moment.js CDN library to display the current date and time. In tandem with a setInterval function, this dynamically updates every second.
  • submitRecall () - This function stores the calender events in localStorage, overwriting and updating any existing calendar events that it encounters.
  • buttonClick () - This function runs when any button is clicked, and it calls the submitRecall function.
  • timeCheck() - This function utilizes the Moment.js CDN library to check for the current time. Depending on the time, the styles of the time-block rows in the html change, corresponding to "past" events, "present" events, or "future" events. This function is called immediately when the page loads.
  • eventsDisplay() - This function recalls the calendar events from localStorage and displays them on the page. This function is called immediately when the page loads.

Final Thoughts

  • This project was an excellect exercise, expanding up Homework 4's use of localStorage.
  • Multiple functions are running simultaneously, and the use of javascript CDNs (jQuery, Moment.js) was new.
  • Dynamically updating styles based on time of day was a unique implementation
  • Further notes have been commented upon with the code itself.

work-day-scheduler's People

Contributors

jpbrickhouse 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.