npm.io
1.0.0 • Published 7 years ago

@ryanlsmith/date_lib

Licence
MIT
Version
1.0.0
Deps
0
Size
8 kB
Vulns
0
Weekly
0

Table of Contents

MyDate

This class creates a Date obj out of an args array

Parameters
  • args ...any
  • input Date a date in various formats

Returns Date an instantiation of the Date class in js as an object

year

This method on my Date class returns the year of the date formatted as a string

Returns String formated year

month

This method on my Date class returns the month of the date formatted as a string

Returns String formated month

day

This method on my Date class returns the day of the date formatted as a string

Returns String formated day

justHours

This method on my Date class returns the hour of the date formatted as a string

Returns String formated hour

justMins

This method on my Date class returns the mins of the date formatted as a string

Returns String formated mins

justSecs

This method on my Date class returns the year of the date formatted as a string

Returns String formated year

format

This method on my Date class returns the year of the date formatted as a string

Parameters
  • args ...any
Examples
MyDate.format('y/m/d') => 2017/Jan/2 && MyDate.format('H:I:S') => 03:04:05

Returns String formated Date with optional params

when

This method on my Date class returns a description of 'when' a date will happen

Examples
MyDate.when() => todays date - date of constructed date object

Returns String formated Date with the time from today to the constructed date object