文档管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
..
_lib
add_days
add_hours
add_iso_years
add_milliseconds
add_minutes
add_months
add_quarters
add_seconds
add_weeks
add_years
are_ranges_overlapping
closest_index_to
closest_to
compare_asc
compare_desc
difference_in_calendar_days
difference_in_calendar_iso_weeks
difference_in_calendar_iso_years
difference_in_calendar_months
difference_in_calendar_quarters
difference_in_calendar_weeks
difference_in_calendar_years
difference_in_days
difference_in_hours
difference_in_iso_years
difference_in_milliseconds
difference_in_minutes
difference_in_months
difference_in_quarters
difference_in_seconds
difference_in_weeks
difference_in_years
distance_in_words
distance_in_words_strict
distance_in_words_to_now
each_day
end_of_day
end_of_hour
end_of_iso_week
end_of_iso_year
end_of_minute
end_of_month
end_of_quarter
end_of_second
end_of_today
end_of_tomorrow
end_of_week
end_of_year
end_of_yesterday
format
get_date
get_day
get_day_of_year
get_days_in_month
get_days_in_year
get_hours
get_iso_day
get_iso_week
get_iso_weeks_in_year
get_iso_year
get_milliseconds
get_minutes
get_month
get_overlapping_days_in_ranges
get_quarter
get_seconds
get_time
get_year
is_after
is_before
is_date
is_equal
is_first_day_of_month
is_friday
is_future
is_last_day_of_month
is_leap_year
is_monday
is_past
is_same_day
is_same_hour
is_same_iso_week
is_same_iso_year
is_same_minute
is_same_month
is_same_quarter
is_same_second
is_same_week
is_same_year
is_saturday
is_sunday
is_this_hour
is_this_iso_week
is_this_iso_year
is_this_minute
is_this_month
is_this_quarter
is_this_second
is_this_week
is_this_year
is_thursday
is_today
is_tomorrow
is_tuesday
is_valid
is_wednesday
is_weekend
is_within_range
is_yesterday
last_day_of_iso_week
last_day_of_iso_year
last_day_of_month
last_day_of_quarter
last_day_of_week
last_day_of_year
locale
max
min
parse
set_date
set_day
set_day_of_year
set_hours
set_iso_day
set_iso_week
set_iso_year
set_milliseconds
set_minutes
set_month
set_quarter
set_seconds
set_year
start_of_day
start_of_hour
start_of_iso_week
start_of_iso_year
start_of_minute
start_of_month
start_of_quarter
start_of_second
start_of_today
start_of_tomorrow
start_of_week
start_of_year
start_of_yesterday
sub_days
sub_hours
sub_iso_years
sub_milliseconds
sub_minutes
sub_months
sub_quarters
sub_seconds
sub_weeks
sub_years
CHANGELOG.md
LICENSE.md
README.md
docs.json
index.js
package.json
typings.d.ts

README.md

date-fns

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.

Docs

See date-fns.org for more details, API, and other docs.

License

MIT © Sasha Koss