Vue Component To Format Dates Using Moment.js – el-moment

Vue Component To Format Dates Using Moment.js – el-moment

A Vue component for formatting dates using moment.js.

el-moment

Build Status npm

A Vue component of formatting dates using moment.

Installation

yarn add el-moment moment
# npm i el-moment moment -S

Usage

import ElMoment from 'el-moment'

Vue.use(ElMoment)
// or
Vue.component(ElMoment.name, ElMoment)
<!-- component -->
<el-moment v-model="date" format="MMMM Do YYYY, h:mm:ss a">
  <el-date-picker></el-date-picker>
</el-moment>

<!-- native input -->
<el-moment v-model="date" format="MMMM Do YYYY, h:mm:ss a">
  <input type="text">
</el-moment>

**No extra HTML tag is generated

Github Repository

Tags: #VueJs