0.0.2 • Published 7 years ago

vue-time-tag v0.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

vue-time-tag

A component that allows you to use the html <time> element in your Vue.js application. No need to pass the time as a machine readable iso date as well as a human readable formatted date string. vue-time-tag does that for you. It's a small but practical component.

Installation

npm install --save vue-time-tag

or

yarn add vue-time-tag

In your main.js (where you initialize your Vue application)

import TimeTag from 'vue-time-tag'
Vue.use(TimeTag)

Dependencies

Usage

<time-tag :date="myDate">

which renders a <time> element:

<time datetime="2017-08-02T16:40:14.861Z">August 2, 2017 6:40 PM</time>

Pass a date object or a number to the :date attribute.

By default it uses Moment.js with the localized format "LLL". You can overwrite the default by using the format attribute.

For example:

<time-tag :date="myDate" format="YYYY MM DD">

A list of the Moment.js formats available can be found here.

Change log

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email mat@wiemann.name instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.