vue-moment-jalaali
v2.0.0
Published
Jalaali Moment.js filters for your Vue.js project
Downloads
918
Maintainers
Readme
vue-moment-jalaali
Jalaali Moment.js filters for your Vue.js project. This project is based on [vue-moment] (https://github.com/brockpetrie/vue-moment) and [moment-jalaali] (https://github.com/jalaali/moment-jalaali).
Installation
You can install it via NPM:
npm install vue-moment-jalaali
And require plugin like so:
Vue.use(require('vue-moment-jalaali'));
or load vue-moment-jalaali.min.js
along with moment-jalaali.js
the old fashioned way.
Usage
Simply set moment
as the filtering function and you're good to go. At least one argument is expected, which the filter assumes to be a format
string if the argument doesn't match any of the other filtering methods.
Vue.js 2.x.x
<span>{{ someDate | moment("jYYYY/jM/jD HH:mm") }}</span>
<!-- or create a new date from 'now' -->
<span>{{ new Date() | moment("jYYYY/jM/jD HH:mm") }}</span>
Vue.js 1.x.x
<span>{{ someDate | moment "jYYYY/jM/jD HH:mm" }}</span>
<!-- or create a new date from 'now' -->
<span>{{ new Date() | moment "jYYYY/jM/jD HH:mm" }}</span>
For more information, usage and format, you can see these repositories: