5.0.1 • Published 6 months ago

@vue-layout/timeago v5.0.1

Weekly downloads
-
License
-
Repository
github
Last release
6 months ago

@vue-layout/timeago ⏰

npm version CI

A package containing a timeago component.

Table of Contents

Installation

$ npm i --save @vue-layout/timeago

Usage

Register the plugin.

import install from '@vue-layout/timeago';
import { createApp } from 'vue'

const app = createApp({})

app.use(install, {
    /* set the default locale */
    locale: 'en',
});

After the component is registered, it can be used as follows.

<template>
    <VCTimeago
        :date-time="1684746631769"
        :locale="'en'"
        :auto-update="true"
    />
</template>

Locales

To support other locales, the corresponding locale object must be imported from the date-fns library. In the following, this will be shown for the german language.

import install from '@vue-layout/timeago';
import { createApp } from 'vue'

import de from 'date-fns/locale/de';

const app = createApp({})

app.use(install, {
    locale: 'de',
    locales: {
        de,
    },
});

License

Made with 💚

Published under MIT License.

3.6.2

6 months ago

5.0.1

6 months ago

5.0.0

6 months ago

3.0.0

11 months ago

2.4.0

12 months ago

2.3.0

12 months ago