{"id":15019553,"url":"https://github.com/mathiew82/vue-date-now","last_synced_at":"2025-10-24T12:31:29.970Z","repository":{"id":34979396,"uuid":"192236831","full_name":"Mathiew82/vue-date-now","owner":"Mathiew82","description":"Easily work with dates using the available methods.","archived":false,"fork":false,"pushed_at":"2024-01-30T11:21:18.000Z","size":994,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T23:22:58.470Z","etag":null,"topics":["date","datetime","vue","vue-date-now","vuejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Mathiew82.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-06-16T21:05:28.000Z","updated_at":"2023-05-13T03:48:41.000Z","dependencies_parsed_at":"2024-01-30T11:42:13.561Z","dependency_job_id":"300c415b-a3ff-45b9-a99c-0426dbbca837","html_url":"https://github.com/Mathiew82/vue-date-now","commit_stats":{"total_commits":64,"total_committers":2,"mean_commits":32.0,"dds":0.25,"last_synced_commit":"a9501fb53c212182df83fd28fce5e01d4153abf2"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathiew82%2Fvue-date-now","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathiew82%2Fvue-date-now/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathiew82%2Fvue-date-now/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mathiew82%2Fvue-date-now/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mathiew82","download_url":"https://codeload.github.com/Mathiew82/vue-date-now/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237964674,"owners_count":19394442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["date","datetime","vue","vue-date-now","vuejs"],"created_at":"2024-09-24T19:53:41.227Z","updated_at":"2025-10-24T12:31:24.691Z","avatar_url":"https://github.com/Mathiew82.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vue-date-now\n\n![](images/Logo_DateNow_Vue-min.png)\n\nEasily work with dates using the available methods.\n\nFeel free to collaborate. I would like to expand translations, so if you dare! 🚀\n\n[![npm](https://img.shields.io/npm/v/vue-date-now.svg)](https://www.npmjs.com/package/vue-date-now)\n[![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/react.svg)](https://www.npmjs.com/package/vue-date-now)\n[![npm](https://img.shields.io/npm/dt/vue-date-now.svg)](https://www.npmjs.com/package/vue-date-now)\n[![dependencies Status](https://david-dm.org/Mathiew82/vue-date-now/status.svg)](https://david-dm.org/Mathiew82/vue-date-now)\n![GitHub](https://img.shields.io/github/license/Mathiew82/vue-date-now)\n\n\u0026nbsp;\n#### Install with npm:\n\n    npm install vue-date-now\n\n#### or install with yarn\n\n    yarn add vue-date-now\n\n\n\u0026nbsp;\n#### Enable it in your project:\n\n```js\nimport VueDateNow from 'vue-date-now';\n    \nVue.use(VueDateNow);\n```\n\n\u0026nbsp;\n#### Use the available methods:\n\n```js\nexport default {\n    name: 'app',\n    data () {\n        return {\n            year: this.$dn.year(),\n            monthText: this.$dn.monthText()\n        }\n    }\n}\n```\n\n\u0026nbsp;\n## Documentation\n### Notes:\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;This documentation has been created on 2019-06-17.\n\n\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;The monthText method supports all languages thanks to the toLocaleString() method of js\n\n\n\u0026nbsp;\n### Languages available for *howLong* and *dayText* methods:\n| Slug | Language        |\n|:-----|:----------------|\n| es   | Spanish         |\n| en   | English         |\n\n\n\u0026nbsp;\n### Methods\n___\n#### @ date()\n##### # Parameters (3)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object\n* Default: new Date()\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2. # format\n* Required: false\n* Type: String\n* Default: 'yyyy-mm-dd'\n* Description: You can specify the format by passing it a string.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;3. # separator\n* Required: false\n* Type: String\n* Default: '/'\n* Description: You can specify the separator by passing it a string.\n\n##### $ How to use\n```js\nthis.$dn.date(new Date(), 'dd-mm-yyyy', '-') // result = 17-06-2019\nthis.$dn.date(new Date(), 'dd-mm-yyyy') // result = 17/06/2019\nthis.$dn.date(new Date()) // result = 2019/06/17\nthis.$dn.date() // result = 2019/06/17\n```\n___\n#### @ howLong()\n##### # Parameters (2)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: true\n* Type: Date Object || date String || timestamp String\n* Description: It is required to specify the date to obtain the time since then.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2. # language\n* Required: false\n* Type: String\n* Default: 'en'\n* Description: You can specify the language by passing it a string.\n\n##### $ How to use\n```js\nthis.$dn.howLong(new Date('2019-04-08'), 'en') // result = A few months ago\nthis.$dn.howLong('2016-04-22', 'en') // result = More than a year ago\nthis.$dn.howLong('2019-06-17 10:56:47', 'es') // result = Hace unas horas\n```\n___\n#### @ year()\n##### # Parameters (1)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object || date String || timestamp String\n* Default: ''\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### $ How to use\n```js\nthis.$dn.year(new Date()) // result = 2019\nthis.$dn.year('2016-04-22') // result = 2016\nthis.$dn.year('2014-04-22 22:56:47') // result = 2014\nthis.$dn.year() // result = 2019\n```\n___\n#### @ month()\n##### # Parameters (1)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object || date String || timestamp String\n* Default: ''\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### $ How to use\n```js\nthis.$dn.month(new Date()) // result = 06\nthis.$dn.month('2016-04-22') // result = 04\nthis.$dn.month('2014-02-14 22:56:47') // result = 02\nthis.$dn.month() // result = 06\n```\n___\n#### @ monthText()\n##### # Parameters (2)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object || date String || timestamp String\n* Default: ''\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2. # language\n* Required: false\n* Type: String\n* Default: 'en'\n* Description: You can specify the language by passing it a string.\n\n##### $ How to use\n```js\nthis.$dn.monthText(new Date(), 'en') // result = June\nthis.$dn.monthText('2016-01-22', 'es') // result = Enero\nthis.$dn.monthText('2014-03-22 22:56:47', 'es') // result = Marzo\nthis.$dn.monthText('', 'en') // result = June\nthis.$dn.monthText() // result = June\n```\n___\n#### @ day()\n##### # Parameters (1)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object || date String || timestamp String\n* Default: ''\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### $ How to use\n```js\nthis.$dn.day(new Date()) // result = 2\nthis.$dn.day('2016-04-22') // result = 6\nthis.$dn.day('2014-02-14 22:56:47') // result = 3\nthis.$dn.day() // result = 2\n```\n___\n#### @ dayText()\n##### # Parameters (2)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: false\n* Type: Date Object || date String || timestamp String\n* Default: ''\n* Description: You can specify the date by passing this parameter with an instance of the Date object.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2. # language\n* Required: false\n* Type: String\n* Default: 'en'\n* Description: You can specify the language by passing it a string.\n\n##### $ How to use\n```js\nthis.$dn.dayText(new Date(), 'en') // result = Monday\nthis.$dn.dayText('2016-01-22', 'es') // result = Viernes\nthis.$dn.dayText('2014-03-22 22:56:47', 'es') // result = Sábado\nthis.$dn.dayText('', 'en') // result = Monday\nthis.$dn.dayText() // result = Monday\n```\n___\n#### @ diff()\n##### # Parameters (3)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;1. # date\n* Required: true\n* Type: Date Object || date String || timestamp String\n* Description: It is required to specify the most current date of the comparison.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;2. # date\n* Required: true\n* Type: date String || timestamp String\n* Description: It is required to specify the oldest date of comparison.\n\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;3. # type\n* Required: false\n* Type: String\n* Default: 'days'\n* Available values: 'seconds', 'minuts', 'hours', 'days', 'weeks', 'months', 'years'\n* Description: You can specify the type of data to return.\n\n##### $ How to use\n```js\nthis.$dn.diff(new Date(), '2016-08-21', 'years') // result = 2.8\nthis.$dn.diff('2019-03-15', '2016-08-21', 'months') // result = 31.2\nthis.$dn.diff('2019-03-15', '2016-08-21') // result = 936.0\n```\n___\n#### @ time()\n##### # Parameters (0)\n##### \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;0. # without parameters\n\n##### $ How to use\n```js\nthis.$dn.time() // result = 18:31:48\n```\n___\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiew82%2Fvue-date-now","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmathiew82%2Fvue-date-now","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmathiew82%2Fvue-date-now/lists"}