drivetribe-date-formatters

1.6.5 • Public • Published

drivetribe-date-formatters

Collection of date formatter functions to format ISO dates for display purposes.

Install

Install the module directly from npm:

npm install drivetribe-date-formatters --save

Formatters

Relative Date

Converts ISO date or Unix timestamp to a relative date like "just now" or "5 days ago".

relativeDate(date: number||string): string

Convert seconds to duration

Converts a time, given in seconds, to a human-readable duration in the [HH:M]M:SS format.

convertSecondsToDuration(seconds: number): string

Time format

Converts ISO date or Unix timestamp to the next time format: HH:MM[pm/am] according to user timezone.

formatTime(date: number||string): string

/drivetribe-date-formatters/

    Package Sidebar

    Install

    npm i drivetribe-date-formatters

    Weekly Downloads

    1

    Version

    1.6.5

    License

    ISC

    Unpacked Size

    9.16 kB

    Total Files

    4

    Last publish

    Collaborators

    • julia.sklyar
    • popmotion