Giter VIP home page Giter VIP logo

dailyscheduler's Introduction

Daily Sheduler

Preface

Our work days can get pretty hectic, and maybe it's hard to keep track of what we're doing throughout the day. For this reason, it's often useful to use a Scheduler, or a Planner, to keep track of your tasks on a daily basis.

Description

In comes the Work Day Scheduler site. This site allows you to jot down your tasks on a scheduler as needed. On top of the page, you'll see the current day, month, and year. There are nine table rows that keep track of every hour representative of that work day, from 9AM-5PM. Its colors of the input text area change depending on whether the specific hour has past (grey), is currently present (green), or has yet to happen (green). What's great, is that all of your tasks are saved even if you close the browser by accident or refresh the page, allowing you to keep track of your daily tasks no matter what.

Methods

The new Date() constructer and its methods were used to get the current day of the week, the current month of the year, the day of that month, and the year. Since the getDay() method only returns a number (0-6), an array was created with the seven days inside of it. 0 represented Sunday, 1 represented Monday, etc. Similarly with the months, getMonth() returned a number (0-11). The same technique was used to retrieve the name of the month.

Alt text

In order to compare the current time to the time assigned to each row, I created an arbitrary attribute called "time". Each HTML element containing a time block was assigned that attribute. The value inputted will represent the time in a 24 hour format. Example, if the timeblock displays 3PM, the attribute "time" will have a value of 15. Then the current hour is retrieved by using the new Date method getHours(). Finally, the time attribute is compared to the current hour. If it is less than the current hour, it'll assign the class "past" to the appropriate text area. If it is equal to current hour, the class "present" will be assigned. If it is greater than, then "future" is assigned.

Alt text

Finally, event listeners were added to each individual button that would take in the input value of the given text area and save it in local storage. That same text area will retrieve the value inputted into local storage and keep the text displayed.

dailyscheduler's People

Contributors

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