All Projects → vuejs-community → vue-filter-date-format

vuejs-community / vue-filter-date-format

Licence: MIT License
Simple date formatting filter for Vue.js

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to vue-filter-date-format

vue-filter-pluralize
Simple pluralize filter for Vue.js
Stars: ✭ 13 (-88.29%)
Mutual labels:  vue-filter, vue-filters
vue-string-filter
✂️ Vue 2.x lightweight string manipulation filter
Stars: ✭ 38 (-65.77%)
Mutual labels:  vue-filter
Vue Element Loading
⏳ Loading inside a container or full screen for Vue.js
Stars: ✭ 234 (+110.81%)
Mutual labels:  vuejs2
Vue Mapbox Gl
A Vue.js component for Mapbox GL JS
Stars: ✭ 242 (+118.02%)
Mutual labels:  vuejs2
Monkov
A blog system built with vue and koa
Stars: ✭ 234 (+110.81%)
Mutual labels:  vuejs2
Vue Product Zoomer
Zoom Prodct Image, useful for e-shop website
Stars: ✭ 248 (+123.42%)
Mutual labels:  vuejs2
Vue2 Scrollbar
The Simplest Pretty Scroll Area Component with custom scrollbar for Vue 2. https://bosnaufal.github.io/vue2-scrollbar
Stars: ✭ 233 (+109.91%)
Mutual labels:  vuejs2
blog-frontend
Frontend of blog created using: GraphQL (Apollo) + Vue + Nuxt.js + TypeScript + Vuetify...
Stars: ✭ 43 (-61.26%)
Mutual labels:  vuejs2
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+127.93%)
Mutual labels:  vuejs2
Vue Tabs
Simplified bootstrap tabs
Stars: ✭ 241 (+117.12%)
Mutual labels:  vuejs2
Pretty Checkbox Vue
Quickly integrate pretty checkbox components with Vue.js
Stars: ✭ 240 (+116.22%)
Mutual labels:  vuejs2
Copilot
Responsive Bootstrap 3 Admin Template based on AdminLTE with vue.js
Stars: ✭ 2,698 (+2330.63%)
Mutual labels:  vuejs2
Vue Cnode
🔥Vue.js打造一个开源的CNode社区。CNode by Vue.js
Stars: ✭ 249 (+124.32%)
Mutual labels:  vuejs2
Vue Fab
Vue Floating Action Button
Stars: ✭ 233 (+109.91%)
Mutual labels:  vuejs2
Vue Scroll
Scroll directive on vue
Stars: ✭ 238 (+114.41%)
Mutual labels:  vuejs2
Vue Material Kit
Vue Material Kit - Open Source Material Design UI Kit
Stars: ✭ 231 (+108.11%)
Mutual labels:  vuejs2
Vue Examples
Collection of Vue examples for beginner front end developers
Stars: ✭ 244 (+119.82%)
Mutual labels:  vuejs2
RumahSakitJakarta
🏥 Daftar Rumah Sakit Umum, Khusus dan Puskesmas di Jakarta
Stars: ✭ 23 (-79.28%)
Mutual labels:  vuejs2
vue-filter-number-format
Vue.js filter for formatting numbers
Stars: ✭ 17 (-84.68%)
Mutual labels:  vue-filter
H5 Editor
📕h5可视化编辑器,支持添加图片/文本/形状等,拥有图层/参考线/标尺/自动吸附对齐等功能
Stars: ✭ 224 (+101.8%)
Mutual labels:  vuejs2

@vuejs-community/vue-filter-date-format

Simple datetime filter for Vue.js

Installation

install from npm

$ npm install @vuejs-community/vue-filter-date-format

and register in you Vue app

import Vue from 'vue';
import VueFilterDateFormat from '@vuejs-community/vue-filter-date-format';

Vue.use(VueFilterDateFormat);

or register in you Vue app with config

import Vue from 'vue';
import VueFilterDateFormat from '@vuejs-community/vue-filter-date-format';

Vue.use(VueFilterDateFormat, {
  dayOfWeekNames: [
    'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
    'Friday', 'Saturday'
  ],
  dayOfWeekNamesShort: [
    'Su', 'Mo', 'Tu', 'We', 'Tr', 'Fr', 'Sa'
  ],
  monthNames: [
    'January', 'February', 'March', 'April', 'May', 'June',
    'July', 'August', 'September', 'October', 'November', 'December'
  ],
  monthNamesShort: [
    'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
    'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
  ],
  // Timezone offset, in minutes (0 - UTC, 180 - Russia, undefined - current)
  timezone: 0
});

Usage

basic usage

<template>
  <div>{{ new Date() | dateFormat('YYYY.MM.DD') }}</div>
</template>

usage with config

<template>
  <div>{{ new Date() | dateFormat('YYYY.MM.DD', dateFormatConfig) }}</div>
</template>

<script>
  export default {
    data () {
      return {
        dateFormatConfig: {
          dayOfWeekNames: [
            'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday',
            'Friday', 'Saturday'
          ],
          dayOfWeekNamesShort: [
            'Su', 'Mo', 'Tu', 'We', 'Tr', 'Fr', 'Sa'
          ],
          monthNames: [
            'January', 'February', 'March', 'April', 'May', 'June',
            'July', 'August', 'September', 'October', 'November', 'December'
          ],
          monthNamesShort: [
            'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'
          ],
          // Timezone offset, in minutes (0 - UTC, 180 - Russia, undefined - current)
          timezone: 0
        }
      };
    }
  };
</script>

usage with dateParse filter:

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

Format Options

Key Output
Year YYYY 1970 1971 ... 2029 2030
YY 70 71 ... 29 30
Month MMMM January February ... November December
MMM Jan Feb ... Nov Dec
MM 01 02 ... 11 12
M 1 2 ... 11 12
Day DD 01 02 ... 30 31
D 1 2 ... 30 31
Hour HH 00 01 ... 22 23
H 0 1 ... 22 23
hh 01 02 ... 11 12
h 1 2 ... 11 12
AM/PM A AM PM
a am pm
Minute mm 00 01 ... 58 59
m 0 1 ... 58 59
Second ss 00 01 ... 58 59
s 0 1 ... 58 59
Millisecond S 0 1 ... 58 59
SSS 000 001 ... 058 059
Day of Week dddd Sunday Monday ... Friday Saturday
dd Su Mo ... Fr Sa
d 0 1 ... 5 6

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

License

MIT © Vue.js Community

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].