Working with Day.js: Adding Time to Dates

Easy
1
0.0% Acceptance

In this lab, you will learn how to use the Day.js library to add specific amounts of time (days, hours, minutes, seconds, and milliseconds) to an existing date. Day.js is a lightweight and easy-to-use library for handling dates and times in JavaScript.

In order to complete this lab, you will need to have Day.js installed. You can do this by running npm install dayjs or yarn add dayjs. Throughout the challenges, you will work with the dayjs object and the add() function to manipulate dates.

Challenges

  1. Import Day.js and create a dayjs object.
  2. Add days to the dayjs object.
  3. Add hours to the dayjs object.
  4. Add minutes to the dayjs object.
  5. Add seconds to the dayjs object.
  6. Add milliseconds to the dayjs object.
  7. Export the final dayjs object.

Make sure to export anything you create in the respective challenge.

Good luck!