A Vue.js plugin to display dates, datetimes, and times. Uses moment.js.
The full list of included filters:
Filter | Output |
---|---|
time | 12:00 am |
shortTime | 12:00 |
longTime | 12:00:00 am |
date | 2018-04-05 |
shortDate | 2018-4-5 |
writtenDate | Apr 5th, 2018 |
dateTime | 2018-04-05 12:00 am |
shortDateTime | 2018-4-5 12:00 am |
writtenDateTime | Apr 5th, 2018, 12:00 am |
utcToLocal | 2018-04-05T00:00:00.000Z |
localToUtc | 2018-04-05T05:00:00.000Z |
See "docs" directory for example.
You can install the package via yarn:
yarn add vue-date-filters
or npm:
npm install vue-date-filters --save
import VueDates from "vue-date-filters";
Vue.use(VueDates);
In your template:
{{ "2018-14-18" | longDate }}
npm test
Please see CHANGELOG for more information what has changed recently.
If you discover any security related issues, please contact John Gile.
The MIT License (MIT). Please see License File for more information.