Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

3 Commits

Repository files navigation

within

Date(now + 1e3) // => "in a second"

Installation

Install with component(1):

$ component install yields/within

API

within(date)

Convert the given Date to a human readable string.

Examples

within(newDate-6e4);// => ""within(newDate);// => "just now"within(+newDate+1e3);// => "in a second"within(+newDate+1e3*5);// => "in 5 seconds"within(+newDate+6e4);// => "in a minute"within(+newDate+6e4*5);// => "in 5 minutes"within(+newDate+6e4*60);// => "in an hour"within(+newDate+6e4*120);// => "in 2 hours"within(+newDate+8.64e+7);// => "in a day"within(+newDate+8.64e+7*2);// => "in 2 days"within(+newDate+8.64e+7*7);// => "in a week"within(+newDate+2.63e+9);// => "in a month"within(+newDate+2.63e+9*2);// => "in 2 months"within(+newDate+2.63e+9*12);// => "in a year"within(+newDate+3.156e+10*9);// => "in 9 years"within(+newDate+3.156e+10*10);// => "in a decade"

License

MIT

About

Date(now + 1e3) => "in a second"

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages