|
|
il y a 2 ans | |
|---|---|---|
| .. | ||
| _lib | il y a 2 ans | |
| add_days | il y a 2 ans | |
| add_hours | il y a 2 ans | |
| add_iso_years | il y a 2 ans | |
| add_milliseconds | il y a 2 ans | |
| add_minutes | il y a 2 ans | |
| add_months | il y a 2 ans | |
| add_quarters | il y a 2 ans | |
| add_seconds | il y a 2 ans | |
| add_weeks | il y a 2 ans | |
| add_years | il y a 2 ans | |
| are_ranges_overlapping | il y a 2 ans | |
| closest_index_to | il y a 2 ans | |
| closest_to | il y a 2 ans | |
| compare_asc | il y a 2 ans | |
| compare_desc | il y a 2 ans | |
| difference_in_calendar_days | il y a 2 ans | |
| difference_in_calendar_iso_weeks | il y a 2 ans | |
| difference_in_calendar_iso_years | il y a 2 ans | |
| difference_in_calendar_months | il y a 2 ans | |
| difference_in_calendar_quarters | il y a 2 ans | |
| difference_in_calendar_weeks | il y a 2 ans | |
| difference_in_calendar_years | il y a 2 ans | |
| difference_in_days | il y a 2 ans | |
| difference_in_hours | il y a 2 ans | |
| difference_in_iso_years | il y a 2 ans | |
| difference_in_milliseconds | il y a 2 ans | |
| difference_in_minutes | il y a 2 ans | |
| difference_in_months | il y a 2 ans | |
| difference_in_quarters | il y a 2 ans | |
| difference_in_seconds | il y a 2 ans | |
| difference_in_weeks | il y a 2 ans | |
| difference_in_years | il y a 2 ans | |
| distance_in_words | il y a 2 ans | |
| distance_in_words_strict | il y a 2 ans | |
| distance_in_words_to_now | il y a 2 ans | |
| each_day | il y a 2 ans | |
| end_of_day | il y a 2 ans | |
| end_of_hour | il y a 2 ans | |
| end_of_iso_week | il y a 2 ans | |
| end_of_iso_year | il y a 2 ans | |
| end_of_minute | il y a 2 ans | |
| end_of_month | il y a 2 ans | |
| end_of_quarter | il y a 2 ans | |
| end_of_second | il y a 2 ans | |
| end_of_today | il y a 2 ans | |
| end_of_tomorrow | il y a 2 ans | |
| end_of_week | il y a 2 ans | |
| end_of_year | il y a 2 ans | |
| end_of_yesterday | il y a 2 ans | |
| format | il y a 2 ans | |
| get_date | il y a 2 ans | |
| get_day | il y a 2 ans | |
| get_day_of_year | il y a 2 ans | |
| get_days_in_month | il y a 2 ans | |
| get_days_in_year | il y a 2 ans | |
| get_hours | il y a 2 ans | |
| get_iso_day | il y a 2 ans | |
| get_iso_week | il y a 2 ans | |
| get_iso_weeks_in_year | il y a 2 ans | |
| get_iso_year | il y a 2 ans | |
| get_milliseconds | il y a 2 ans | |
| get_minutes | il y a 2 ans | |
| get_month | il y a 2 ans | |
| get_overlapping_days_in_ranges | il y a 2 ans | |
| get_quarter | il y a 2 ans | |
| get_seconds | il y a 2 ans | |
| get_time | il y a 2 ans | |
| get_year | il y a 2 ans | |
| is_after | il y a 2 ans | |
| is_before | il y a 2 ans | |
| is_date | il y a 2 ans | |
| is_equal | il y a 2 ans | |
| is_first_day_of_month | il y a 2 ans | |
| is_friday | il y a 2 ans | |
| is_future | il y a 2 ans | |
| is_last_day_of_month | il y a 2 ans | |
| is_leap_year | il y a 2 ans | |
| is_monday | il y a 2 ans | |
| is_past | il y a 2 ans | |
| is_same_day | il y a 2 ans | |
| is_same_hour | il y a 2 ans | |
| is_same_iso_week | il y a 2 ans | |
| is_same_iso_year | il y a 2 ans | |
| is_same_minute | il y a 2 ans | |
| is_same_month | il y a 2 ans | |
| is_same_quarter | il y a 2 ans | |
| is_same_second | il y a 2 ans | |
| is_same_week | il y a 2 ans | |
| is_same_year | il y a 2 ans | |
| is_saturday | il y a 2 ans | |
| is_sunday | il y a 2 ans | |
| is_this_hour | il y a 2 ans | |
| is_this_iso_week | il y a 2 ans | |
| is_this_iso_year | il y a 2 ans | |
| is_this_minute | il y a 2 ans | |
| is_this_month | il y a 2 ans | |
| is_this_quarter | il y a 2 ans | |
| is_this_second | il y a 2 ans | |
| is_this_week | il y a 2 ans | |
| is_this_year | il y a 2 ans | |
| is_thursday | il y a 2 ans | |
| is_today | il y a 2 ans | |
| is_tomorrow | il y a 2 ans | |
| is_tuesday | il y a 2 ans | |
| is_valid | il y a 2 ans | |
| is_wednesday | il y a 2 ans | |
| is_weekend | il y a 2 ans | |
| is_within_range | il y a 2 ans | |
| is_yesterday | il y a 2 ans | |
| last_day_of_iso_week | il y a 2 ans | |
| last_day_of_iso_year | il y a 2 ans | |
| last_day_of_month | il y a 2 ans | |
| last_day_of_quarter | il y a 2 ans | |
| last_day_of_week | il y a 2 ans | |
| last_day_of_year | il y a 2 ans | |
| locale | il y a 2 ans | |
| max | il y a 2 ans | |
| min | il y a 2 ans | |
| parse | il y a 2 ans | |
| set_date | il y a 2 ans | |
| set_day | il y a 2 ans | |
| set_day_of_year | il y a 2 ans | |
| set_hours | il y a 2 ans | |
| set_iso_day | il y a 2 ans | |
| set_iso_week | il y a 2 ans | |
| set_iso_year | il y a 2 ans | |
| set_milliseconds | il y a 2 ans | |
| set_minutes | il y a 2 ans | |
| set_month | il y a 2 ans | |
| set_quarter | il y a 2 ans | |
| set_seconds | il y a 2 ans | |
| set_year | il y a 2 ans | |
| start_of_day | il y a 2 ans | |
| start_of_hour | il y a 2 ans | |
| start_of_iso_week | il y a 2 ans | |
| start_of_iso_year | il y a 2 ans | |
| start_of_minute | il y a 2 ans | |
| start_of_month | il y a 2 ans | |
| start_of_quarter | il y a 2 ans | |
| start_of_second | il y a 2 ans | |
| start_of_today | il y a 2 ans | |
| start_of_tomorrow | il y a 2 ans | |
| start_of_week | il y a 2 ans | |
| start_of_year | il y a 2 ans | |
| start_of_yesterday | il y a 2 ans | |
| sub_days | il y a 2 ans | |
| sub_hours | il y a 2 ans | |
| sub_iso_years | il y a 2 ans | |
| sub_milliseconds | il y a 2 ans | |
| sub_minutes | il y a 2 ans | |
| sub_months | il y a 2 ans | |
| sub_quarters | il y a 2 ans | |
| sub_seconds | il y a 2 ans | |
| sub_weeks | il y a 2 ans | |
| sub_years | il y a 2 ans | |
| CHANGELOG.md | il y a 2 ans | |
| LICENSE.md | il y a 2 ans | |
| README.md | il y a 2 ans | |
| docs.json | il y a 2 ans | |
| index.js | il y a 2 ans | |
| package.json | il y a 2 ans | |
| typings.d.ts | il y a 2 ans | |
Pinned: see a brief comparison with Moment.js.
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js.
date-fns is like lodash for dates. It has 140+ functions for all occasions.
dateFns.format(new Date(2014, 1, 11), 'MM/DD/YYYY')
//=> '02/11/2014'
var dates = [new Date(1995, 6, 2), new Date(1987, 1, 11), new Date(1989, 6, 10)]
dates.sort(dateFns.compareAsc)
//=> [
// Wed Feb 11 1987 00:00:00,
// Mon Jul 10 1989 00:00:00,
// Sun Jul 02 1995 00:00:00
// ]
The library is available as an npm package, a Bower package. To install a package run:
npm install date-fns --save
# or with yarn
yarn add date-fns
# or with bower
bower install date-fns
Also, you can simply download the library from the releases page.
See date-fns.org for more details, API, and other docs.