@nuxtjs/date-fns
Advanced tools
+7
-0
@@ -5,2 +5,9 @@ # Changelog | ||
| ## [1.1.0](https://github.com/nuxt-community/date-fns-module/compare/v1.0.0...v1.1.0) (2019-11-18) | ||
| ### Features | ||
| * improve types ([#22](https://github.com/nuxt-community/date-fns-module/issues/22)) ([a901a18](https://github.com/nuxt-community/date-fns-module/commit/a901a18)) | ||
| ## [1.0.0](https://github.com/nuxt-community/date-fns-module/compare/v0.2.0...v1.0.0) (2019-09-05) | ||
@@ -7,0 +14,0 @@ |
+2
-2
| import * as dateFns from 'date-fns' | ||
| <% if(options.locales) { %> | ||
| <% if (options.locales) { %> | ||
| import { <%= options.locales.join(', ') %> } from 'date-fns/locale' | ||
@@ -66,3 +66,3 @@ <% } %> | ||
| <% if(options.defaultLocale) { %> | ||
| <% if (options.defaultLocale) { %> | ||
| options = { locale: '<%= options.defaultLocale %>', ...options } | ||
@@ -69,0 +69,0 @@ <% } %> |
+2
-2
| { | ||
| "name": "@nuxtjs/date-fns", | ||
| "version": "1.0.0", | ||
| "version": "1.1.0", | ||
| "description": "Modern JavaScript date utility library - date-fns for Nuxt.js", | ||
@@ -22,3 +22,3 @@ "repository": "nuxt-community/date-fns-module", | ||
| "dependencies": { | ||
| "date-fns": "^2.0.1" | ||
| "date-fns": "^2.7.0" | ||
| }, | ||
@@ -25,0 +25,0 @@ "devDependencies": { |
+35
-7
@@ -9,3 +9,3 @@ # @nuxtjs/date-fns | ||
| > Modern JavaScript date utility library - [date-fns](https://date-fns.org/) for Nuxt.js | ||
| > Modern JavaScript date utility library - date-fns for Nuxt.js | ||
@@ -19,10 +19,12 @@ [📖 **Release Notes**](./CHANGELOG.md) | ||
| ```bash | ||
| yarn add @nuxtjs/date-fns # or npm install @nuxtjs/date-fns | ||
| yarn add --dev @nuxtjs/date-fns # or npm install --save-dev @nuxtjs/date-fns | ||
| ``` | ||
| 2. Add `@nuxtjs/date-fns` to the `modules` section of `nuxt.config.js` | ||
| 2. Add `@nuxtjs/date-fns` to the `buildModules` section of `nuxt.config.js` | ||
| :warning: If you are using Nuxt older than **v2.9** you have to install module as a `dependency` (No `--dev` or `--save-dev` flags) and also use `modules` section in `nuxt.config.js` instead of `buildModules`. | ||
| ```js | ||
| { | ||
| modules: [ | ||
| export default { | ||
| buildModules: [ | ||
| // Simple usage | ||
@@ -40,4 +42,4 @@ '@nuxtjs/date-fns', | ||
| ```js | ||
| { | ||
| modules: [ | ||
| export default { | ||
| buildModules: [ | ||
| '@nuxtjs/date-fns' | ||
@@ -51,2 +53,25 @@ ], | ||
| ### Typescript setup | ||
| Add the types to your `"types"` array in `tsconfig.json` after the `@nuxt/types` entry. | ||
| :warning: Use `@nuxt/vue-app` instead of `@nuxt/types` for nuxt < 2.9. | ||
| #### tsconfig.json | ||
| ```json | ||
| { | ||
| "compilerOptions": { | ||
| "types": [ | ||
| "@nuxt/types", | ||
| "@nuxtjs/date-fns" | ||
| ] | ||
| } | ||
| } | ||
| ``` | ||
| > **Why?** | ||
| > | ||
| > For typescript to be aware of the additions to the `nuxt Context`, the `vue instance` and the `vuex store`, the types need to be merged via [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) by adding `@nuxtjs/date-fns` to your types. | ||
| ## Options | ||
@@ -56,2 +81,3 @@ | ||
| - Type: `Array[String]` | ||
| - Default: `[]` | ||
@@ -63,2 +89,3 @@ | ||
| - Type: `String` | ||
| - Default: `null` | ||
@@ -70,2 +97,3 @@ | ||
| - Type: `String` | ||
| - Default: `null` | ||
@@ -72,0 +100,0 @@ |
+6
-0
@@ -22,1 +22,7 @@ import Vue from 'vue' | ||
| } | ||
| declare module 'vuex/types/index' { | ||
| interface Store<S> { | ||
| readonly $dateFns: dateFns | ||
| } | ||
| } |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24134
5.65%513
0.98%150
22.95%0
-100%Updated