@nuxtjs/date-fns
Advanced tools
+12
-0
@@ -5,2 +5,14 @@ # Changelog | ||
| ## [1.3.0](https://github.com/nuxt-community/date-fns-module/compare/v1.2.0...v1.3.0) (2020-05-05) | ||
| ### Features | ||
| * add `formatDistanceToNowStrict` ([86b2601](https://github.com/nuxt-community/date-fns-module/commit/86b260175f21555f27326d47cc030277bdc6b8bd)) | ||
| ### Bug Fixes | ||
| * types ([ca48455](https://github.com/nuxt-community/date-fns-module/commit/ca484551fd9528f201494e299ebcb06ca783bbac)) | ||
| ## [1.2.0](https://github.com/nuxt-community/date-fns-module/compare/v1.1.0...v1.2.0) (2020-01-27) | ||
@@ -7,0 +19,0 @@ |
+1
-0
@@ -57,2 +57,3 @@ <% if (options.methods) { %> | ||
| 'formatDistanceToNow', | ||
| 'formatDistanceToNowStrict', | ||
| 'getWeek', | ||
@@ -59,0 +60,0 @@ 'getWeekOfMonth', |
+4
-5
| { | ||
| "name": "@nuxtjs/date-fns", | ||
| "version": "1.2.0", | ||
| "version": "1.3.0", | ||
| "description": "Modern JavaScript date utility library - date-fns for Nuxt.js", | ||
@@ -10,2 +10,4 @@ "repository": "nuxt-community/date-fns-module", | ||
| ], | ||
| "main": "lib/module.js", | ||
| "types": "types/index.d.ts", | ||
| "files": [ | ||
@@ -15,4 +17,2 @@ "lib", | ||
| ], | ||
| "main": "lib/module.js", | ||
| "types": "types/index.d.ts", | ||
| "scripts": { | ||
@@ -24,3 +24,3 @@ "lint": "eslint --ext .js,.vue .", | ||
| "dependencies": { | ||
| "date-fns": "^2.9.0" | ||
| "date-fns": "^2.12.0" | ||
| }, | ||
@@ -32,3 +32,2 @@ "devDependencies": { | ||
| "@nuxtjs/module-test-utils": "latest", | ||
| "codecov": "latest", | ||
| "eslint": "latest", | ||
@@ -35,0 +34,0 @@ "husky": "latest", |
+7
-7
@@ -5,3 +5,3 @@ # @nuxtjs/date-fns | ||
| [![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
| [![Circle CI][circle-ci-src]][circle-ci-href] | ||
| [![Github Actions CI][github-actions-ci-src]][github-actions-ci-href] | ||
| [![Codecov][codecov-src]][codecov-href] | ||
@@ -144,15 +144,15 @@ [![License][license-src]][license-href] | ||
| <!-- Badges --> | ||
| [npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/date-fns/latest.svg?style=flat-square | ||
| [npm-version-src]: https://img.shields.io/npm/v/@nuxtjs/date-fns/latest.svg | ||
| [npm-version-href]: https://npmjs.com/package/@nuxtjs/date-fns | ||
| [npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/date-fns.svg?style=flat-square | ||
| [npm-downloads-src]: https://img.shields.io/npm/dt/@nuxtjs/date-fns.svg | ||
| [npm-downloads-href]: https://npmjs.com/package/@nuxtjs/date-fns | ||
| [circle-ci-src]: https://img.shields.io/circleci/project/github/nuxt-community/date-fns-module.svg?style=flat-square | ||
| [circle-ci-href]: https://circleci.com/gh/nuxt-community/date-fns-module | ||
| [github-actions-ci-src]: https://github.com/nuxt-community/date-fns-module/workflows/ci/badge.svg | ||
| [github-actions-ci-href]: https://github.com/nuxt-community/date-fns-module/actions?query=workflow%3Aci | ||
| [codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/date-fns-module.svg?style=flat-square | ||
| [codecov-src]: https://img.shields.io/codecov/c/github/nuxt-community/date-fns-module.svg | ||
| [codecov-href]: https://codecov.io/gh/nuxt-community/date-fns-module | ||
| [license-src]: https://img.shields.io/npm/l/@nuxtjs/date-fns.svg?style=flat-square | ||
| [license-src]: https://img.shields.io/npm/l/@nuxtjs/date-fns.svg | ||
| [license-href]: https://npmjs.com/package/@nuxtjs/date-fns |
+73
-4
| import { Interval, Locale } from 'date-fns' | ||
| export interface dateFns { | ||
| interface dateFns { | ||
| add(date: Date | number, duration: Duration): Date | ||
| addBusinessDays(date: Date | number, amount: number): Date | ||
@@ -28,3 +30,6 @@ | ||
| intervalLeft: Interval, | ||
| intervalRight: Interval | ||
| intervalRight: Interval, | ||
| options?: { | ||
| inclusive?: boolean | ||
| } | ||
| ): boolean | ||
@@ -123,2 +128,4 @@ | ||
| eachMonthOfInterval(interval: Interval): Date[] | ||
| eachWeekendOfInterval(interval: Interval): Date[] | ||
@@ -138,2 +145,4 @@ | ||
| eachYearOfInterval(interval: Interval): Date[] | ||
| endOfDay(date: Date | number): Date | ||
@@ -220,2 +229,30 @@ | ||
| formatDistanceToNowStrict( | ||
| date: Date | number, | ||
| options?: { | ||
| addSuffix?: boolean | ||
| unit?: 'second' | 'minute' | 'hour' | 'day' | 'month' | 'year' | ||
| roundingMethod?: 'floor' | 'ceil' | 'round' | ||
| locale?: Locale | ||
| } | ||
| ): string | ||
| formatISO( | ||
| date: Date | number, | ||
| options?: { | ||
| format?: 'extended' | 'basic' | ||
| representation?: 'complete' | 'date' | 'time' | ||
| } | ||
| ): string | ||
| formatISO9075( | ||
| date: Date | number, | ||
| options?: { | ||
| format?: 'extended' | 'basic' | ||
| representation?: 'complete' | 'date' | 'time' | ||
| } | ||
| ): string | ||
| formatISODuration(duration: Duration): string | ||
| formatRelative( | ||
@@ -230,2 +267,11 @@ date: Date | number, | ||
| formatRFC3339( | ||
| date: Date | number, | ||
| options?: { | ||
| fractionDigits?: 0 | 1 | 2 | 3 | ||
| } | ||
| ): string | ||
| formatRFC7231(date: Date | number): string | ||
| fromUnixTime(unixTime: number): Date | ||
@@ -235,3 +281,3 @@ | ||
| getDay(date: Date | number): number | ||
| getDay(date: Date | number): 0 | 1 | 2 | 3 | 4 | 5 | 6 | ||
@@ -311,2 +357,4 @@ getDayOfYear(date: Date | number): number | ||
| intervalToDuration(interval: Interval): Duration | ||
| isAfter(date: Date | number, dateToCompare: Date | number): boolean | ||
@@ -320,2 +368,4 @@ | ||
| isExists(year: number, month: number, day: number): boolean | ||
| isFirstDayOfMonth(date: Date | number): boolean | ||
@@ -440,3 +490,3 @@ | ||
| formatString: string, | ||
| backupDate: Date | number, | ||
| referenceDate: Date | number, | ||
| options?: { | ||
@@ -458,2 +508,4 @@ locale?: Locale | ||
| parseJSON(argument: string | number | Date): Date | ||
| roundToNearestMinutes( | ||
@@ -466,2 +518,15 @@ date: Date | number, | ||
| set( | ||
| date: Date | number, | ||
| values: { | ||
| year?: number | ||
| month?: number | ||
| date?: number | ||
| hours?: number | ||
| minutes?: number | ||
| seconds?: number | ||
| milliseconds?: number | ||
| } | ||
| ): Date | ||
| setDate(date: Date | number, dayOfMonth: number): Date | ||
@@ -563,2 +628,6 @@ | ||
| sub(date: Date | number, duration: Duration): Date | ||
| subBusinessDays(date: Date | number, amount: number): Date | ||
| subDays(date: Date | number, amount: number): Date | ||
@@ -565,0 +634,0 @@ |
26942
7.51%9
-10%585
10.38%Updated