CIS 119 - Dates and times

The objectives of this assignment are:

  1. use the JavaScript Date object to get and manipulate dates
  2. use functions in JavaScript to format dates and times
  3. use a custom library (dateformat.js)
  4. use JavaScript to dynamically change a web page

Overview

This assignment is to create a page with dynamic content based upon the date and time.

Image of assignment working

Good morning,

Today's date is: Friday, February 13, 2015
The time is: 09:48:59 AM

My anniversary is on: Tuesday, July 5, 2015 

I was born on: Thursday, July 16, 1987

This document was last modified on: Thursday, February 12, 2015 at 10:48:54 AM

Program Specifications

  1. ALL dates and times are required to be created as JavaScript Date objects.
  2. Create a page which will format and display four dates as shown in the sample output.
  3. Use the dateformat.js library to make formatting the dates easier.
  4. The page should display a greeting which changes depending on whether it is morning (4am-noon), afternoon (noon-6pm), or evening (6pm-4am) when the page is loaded.
  5. Create a Date object with the current date and time and then display it formatted as shown on the sample.
  6. Create a Date object with a date that is important to you (other than your birthday), and then display it formatted as shown on the sample.
  7. Create a Date object with your birthday and then display it formatted as shown on the sample.
  8. Create a Date object with the web page's last modification date and time and then display it formatted as shown on the sample.

Grading rubric

  1. 5 pts: The page has proper documentation comments and follows current standards.
  2. 6 pts: The greeting works properly and changes depending upon the time of day the page is loaded.
  3. 6 pts: The display for the current date and time works properly and is formatted as shown in the sample output.
  4. 6 pts: The display for the important date works properly and is formatted as shown in the sample output.
  5. 6 pts: The display for your birthday works properly and is formatted as shown in the sample output.
  6. 6 pts: The display for the last modification date and time works properly and is formatted as shown in the sample output.
  7. 5 pts: The dateformat.js library is included and used properly.