/vanilla-JS-calendar

A calendar component made out of vanilla JS

Primary LanguageJavaScript

Code Exercise - Calendar

Live Demo of the calendar

Changes and Improvements

  • additional animation such as sliding transitions
  • provide documentation for other developers
  • remove all hardcoded HTML and instead create all scaffolding elements using Javascript
  • ensure the calendar is fully responsive on all browsers and devices (via media queries, setting viewport, using relative units instead of pixels for CSS)

Production-Ready Features

  • write unit tests for the Calendar class functions

  • if this calendar is for displaying read-only dates, implement different views such as displaying the full calendar with the date highlighted or a text input view, or highlighting days

  • for date selection, implement features such as selecting a range of dates, disabling selection of certain dates, constraining selection to a min or max date

  • toolbar navigation with buttons to go to "today" or one year from current date or dropdown menus to select specific months and years

  • create separate views for a day, week, and month

  • include ability to choose preferred date format such as "yyyy/mm/dd" and storing user preferences in a stateful structure such as a cookie

  • add keyboard shortcuts like using arrow keys or browsing days or enter key for confirming selection