Skip to content
Simple date parsing filter for Vue.js
TypeScript JavaScript
Branch: master
Clone or download
eduardnikolenko Merge pull request #29 from eduardnikolenko/dependabot/npm_and_yarn/r…
…ollup-1.20.1

Bump rollup from 1.20.0 to 1.20.1
Latest commit 26339de Aug 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Delete main.workflow Aug 22, 2019
src Fix parse Apr 22, 2019
.editorconfig Initial commit Dec 21, 2018
.gitattributes Initial commit Dec 21, 2018
.gitignore Initial commit Dec 21, 2018
LICENSE Initial commit Dec 21, 2018
README.md Fix docs Jul 20, 2019
package-lock.json Bump rollup from 1.20.0 to 1.20.1 Aug 22, 2019
package.json Fix parse Apr 22, 2019
rollup.config.js Update deps Apr 22, 2019
tsconfig.json Initial commit Dec 21, 2018
tslint.json Initial commit Dec 21, 2018

README.md

vue-filter-date-parse

Simple date parsing filter for Vue.js

NPM Version License Downloads Dependabot Status

Installation

install from npm

$ npm install vue-filter-date-parse

and register in you Vue app

import Vue from 'vue'
import VueFilterDateParse from 'vue-filter-date-parse'

Vue.use(VueFilterDateParse)

Usage

Using with dateFormat filter:

<template>
  <div>{{ '10.10.1989' | dateParse('DD.MM.YYYY') | dateFormat('YYYY-MM-DD') }}</div>
</template>

or

<template>
  <div>{{ '10.10.89' | dateParse('DD.MM.YY', { epoch: 1900 }) | dateFormat('YYYY-MM-DD') }}</div>
</template>

render as:

<div>1989-10-10</div>

Format Options

Key Input
Year YYYY 2000 2001 ... 2029 2030
YY 00 01 ... 29 30
Month MM 01 02 ... 11 12
Day DD 01 02 ... 30 31
Hour HH 00 01 ... 22 23
Minute mm 00 01 ... 58 59
Second ss 00 01 ... 58 59

Default format is YYYY.MM.DD HH:mm:ss

License

MIT © Eduard Nikolenko

You can’t perform that action at this time.