timedated
v0.0.3
Published
A time/date framework for JavaScript.
Downloads
3
Readme
TimeDated
The JavaScript Time Module.
API Features - v0.0.3
Day of the Week Detection
Is It The Given Day of The Week?
Get Time w/ Date/Sec
Get Month
Get Year
Get Day
Get Date
API Testing - v0.0.3
- getWeekDay(cap). PASSED
- isWeekDay(is, yes, no). PASSED
- getTime(date, sec). PASSED
- getDate(). PASSED
- getDay(). PASSED
- getMonth(). PASSED
- getYear(). PASSED
Changes - v0.0.3
- Merged DateTime and Time functions.
- Compressed Repetitive Code.
- Switched to TypeScript.
- Now Using Ternarys and Maps for Compression of Code.
How to Use?
timedated.getWeekDay(cap). Cap may have one of many values. Leaving it blank, passing in 'none', 0, or "0", will return the week day in no caps. 'first', 1, or "1", will capitalize the first letter. 'all', 2, or "2", will capitalize all of the letters.
timedated.isWeekDay(is, yes, no). Is is the day of the week. 0-6 are the days of the week starting from Sunday and ending at Saturday. You may put the number in a string or just list the entire day. Ex: timedated.isWeekDay('sunday'). Yes is the return message for when it is that day of the week. Ex: Today is Monday. timedated.isWeekDay('monday', 'true') // returns true. No is the exact same thing as Yes but for when it is false. If no Yes or No is provided, then they will default to true or false boolean values.
timedated.getTime(date, sec). Date and Sec may be either 'true', true, 'false', or false. If no date or sec is provided, they will both default to false. Date determines whether you want to see the date in what it returns. Sec determines whether you want to see the seconds in what it returns.
timedated.getDate(). Returns just the date. Ex: 3/1/2023. timedated.getDay(). Returns just today. Ex: 1 in 3/1/2023. timedated.getMonth(). Returns just the month. Ex: 3 in 3/1/2023. timedated.getYear(). Returns just the year. Ex: 2023 in 3/1/2023.
NONE OF THE ABOVE FUNCTIONS ARE CAP SENSITIVE.