1.4.5 • Published 2 months ago

brew-date v1.4.5

Weekly downloads
-
License
ISC
Repository
github
Last release
2 months ago

A simple javascript package that gives a decent workaround with Dates.

Keep it clean and simple - Development!

Install brew-date by running

npm install brew-date

getFullDate("yyyy/mm/dd")

getFullDate takes up single parameter which is the format of the date. It takes either {"yyyy/mm/dd" || "dd/mm/yyyy"}.

getFullDate(format);

format()

format takes up two parameter, First one is the date and second one is the format {"yyyy/mm/dd" || "dd/mm/yyyy"}.

format(date, format);

formatDate()

formatDate take up parameter as number in the order of year, month, date.

formatDate(year, month, date);

diffBetween()

diffBetween takes up two parameter to return the difference between of two dates in days.

diffBetween(date1, date2);

It takes current date as default second date if not provided.

subDates()

subDates takes up a two parameter, it subtracts the provided date with a number. Returns a date.

subDates(date, number);

subDay()

subDay takes up a two parameter, it subtracts the the provided date with the number, returns a day.

addDates()

addDates takes up a two parameter, it adds the provided date with the number, return a date.

ago()

ago takes up a two date parameter with or without time.

ago(date1 with time, date2 with time);

It takes current date as the default second date if not provided.

It takes date's 12:00 as the default time if not provided.

getDay()

getDay takes a only one parameter as date and return the day of provided date.

getDay(date)

diffSeconds()

diffSeconds takes up two paramter with time to return difference betwen of two dates in seconds.

diffSeconds(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00, if time has not provided.

diffMinutes()

diffMinutes takes up two parameter with time to return difference between two dates in minutes.

diffMinutes(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffHours()

diffHours takes up two parameter with time to return difference between two dates in Hours.

diffHours(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffDays()

diffDays takes up two parameter with time to return difference between two dates in Days.

diffDays(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffWeeks()

diffWeeks takes up two parameter with time to return difference between two dates in weeks

diffWeeks(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffYears()

diffYears takes up two parameter with time to return difference between two dates in Years.

diffYears(date1 with time, date2 with time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

diffMonths()

diffMonths takes up two parameter with time to return difference between two dates in Months.

diffMonths(date1 with time, date2 witht time);

Default date 2 would be current date and time if not provided.

default time would be 12:00 if not provided.

getBetween()

getBetween takes up two parameter to return the dates between the two provided dates.

getBetween(date1, date2);

Between dates would be return in array format.

1.4.5

2 months ago

1.4.4

2 months ago

1.4.3

4 months ago

1.4.2

7 months ago

1.4.1

9 months ago

1.4.0

9 months ago

1.3.9

9 months ago

1.3.7

11 months ago

1.2.8

12 months ago

1.3.6

11 months ago

1.2.7

12 months ago

1.3.5

11 months ago

1.3.4

11 months ago

1.3.3

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.3.8

11 months ago

1.2.9

12 months ago

1.2.0

1 year ago

1.1.1

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.2.6

12 months ago

1.1.7

1 year ago

1.2.5

1 year ago

1.1.6

1 year ago

1.2.4

1 year ago

1.1.5

1 year ago

1.2.3

1 year ago

1.1.4

1 year ago

1.2.2

1 year ago

1.1.3

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago