Date Library
npm install @maricode1111/date-lib- a simple datetime lib
Challenge 0: Setup Project
Challenge 1: Create Class to instantiate Date obj
Challenge 2: Human readable values:
year
month
date
hour
mins
secs
Challenge 3: Format method that takes a "mask" string
default formatted date with no parameters
List of formatting characters:
'Y' -> 2019 (Year full)
'y' -> 19 (Year short)
'M' -> July (Month full)
'm' -> Jul (Month short)
'D' -> 01 (date padded)
'd' -> 1 (date)
'H' -> 05 (Hours padded)
'h' -> 5 (Hours)
'I' -> 08 (Minutes padded)
'i' -> 8 (Minutes)
'S' -> 04 (Seconds padded)
's' -> 4 (Seconds)
Stretch: Add Day of Week
Stretch: Add short Day of Week
TODO: Add 12/24 hour
Challenge 4: when() method
Stretch: when() edge cases
Stretch: make work for hours, min, seconds
Stretch: include date & time
Challenge 5: Document date-lib with JSDoc
Challenge 6: Write Unit Tests
Challenge 7: Publish to npm with these badges:
npm version
license
size
GitHub Issues
Stretch: .toPrimitive() to return String or Num depending on context
References
Date Format By Country Wiki https://en.wikipedia.org/wiki/Date_format_by_country
Luxon https://moment.github.io/luxon/