This is a date library wrapper that extends the functionality of the built-in javascript Date object.
Run the following command in your project folder:
npm install @annapawl/date_library --save
Then add this to your index.js file
require('@annapawl/src/date_library')
const d = new Date('04/11/1993')
fullYear()
This method returns a date's full year (4 digits)
d.fullYear()
→ 1993
shortYear()
This method returns a date's abbreviated year (2 digits)
d.shortYear()
→ 93
monthName()
This method returns a date's month name (January-December)
d.monthName()
→ "April"
dayName()
This method returns a date's day name (Mon-Sun)
d.dayName()
→ "Sunday"
hr()
This method returns hr date was created
d.hr()
→ "String cheese"
min()
This method returns a date's day
d.min()
→ "String cheese"
sec()
This method capitalizes the first letter of an entire string
d.sec()
→ "String cheese"
ms()
this method returns time's min
'd.ms()
→ "String cheese"
Returns human readble description of 'when' a date will occur. Compares date owned by class instance with current date.