Coreo Ionic Date/Time Module

Usage no npm install needed!

<script type="module">
  import coreoIonicDatetime from 'https://cdn.skypack.dev/@coreo/ionic-datetime';



Ionic 2+ module for manipulating dates and times.


yarn add @coreo/ionic-datetime


Import the module in your app.module.ts:

import { CoreoDateTimeModule } from '@coreo/ionic-datetime';
    imports: [
export class AppModule {}


Displays the passed date as a string according to the time ago it occurred, e.g. less than a minute ago, 4 hours ago, etc. Example:

<div>{{ someDateTime | coreoTimeago | async }}</div>

someDateTime can be a Date, number (milliseconds since epoch) or string (ISO 8601 or otherwise parseable by JavaScript).

The pipe returns an Observable, so don't forget to pipe the result through the async pipe! The text will automatically update as time elapses.

The strings emitted by the pipe are translatable via ngx-translate. See the file translations.ts for the complete list. Be sure to include all of these strings in your custom translation file.