Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vuejs-community/vue-filter-date-parse
Simple date parsing filter for Vue.js
https://github.com/vuejs-community/vue-filter-date-parse
parse vue vue-filter vue-filters vuejs vuejs2
Last synced: about 1 month ago
JSON representation
Simple date parsing filter for Vue.js
- Host: GitHub
- URL: https://github.com/vuejs-community/vue-filter-date-parse
- Owner: vuejs-community
- License: mit
- Created: 2018-12-21T18:42:55.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-10T20:53:58.000Z (8 months ago)
- Last Synced: 2024-03-27T08:56:03.514Z (2 months ago)
- Topics: parse, vue, vue-filter, vue-filters, vuejs, vuejs2
- Language: TypeScript
- Homepage:
- Size: 40 KB
- Stars: 26
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue - vue-filter-date-parse - Simple parsing datetime filter for Vue 2. (Components & Libraries / UI Utilities)
README
# @vuejs-community/vue-filter-date-parse
Simple date parsing filter for Vue.js## Installation
install from npm
```bash
$ npm install @vuejs-community/vue-filter-date-parse
```
and register in you Vue app
```js
import Vue from 'vue';
import VueFilterDateParse from '@vuejs-community/vue-filter-date-parse';Vue.use(VueFilterDateParse);
```## Usage
Using with [dateFormat filter](https://github.com/vuejs-community/vue-filter-date-format):
```html
{{ '15.05.1967' | dateParse('DD.MM.YYYY') | dateFormat('YYYY-MM-DD') }}```
or
```html
{{ '15.05.67' | dateParse('DD.MM.YY', { epoch: 1900 }) | dateFormat('YYYY-MM-DD') }}```
render as:
```html
1967-05-15
```## 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 © [Vue.js Community](https://github.com/vuejs-community)