@nlib/date-string

    1.0.1 • Public • Published

    @nlib/date-string

    Build Status Build status codecov dependencies Status devDependencies Status

    Converts an integer to a human readable format.

    Install

    npm install @nlib/date-string
    

    Usage

    const console = require('console');
    const DateString = require('@nlib/date-string');
    const d = new Date(2012, 3, 4, 5, 6, 7);
    const date1 = new DateString('[YYYY]-[MM]-[DD] [hh]:[mm]:[ss]');
    console.log(date1(d));
    // 2012-04-04 05:06:07
    const date2 = new DateString('[YYYY]-[MMM]-[MMMM]-[D] [ddd] [dddd] [h]:[m]:[s]');
    console.log(date2(d));
    // 2012-Apr-April-4 Wed Wednesday 5:6:7

    Javascript API

    new DateString(format: String) → fn(...args) → String

    • format: A string to format the given date-string.
    • args: is passed to construct a date-string object.

    LICENSE

    MIT

    Keywords

    none

    Install

    npm i @nlib/date-string

    DownloadsWeekly Downloads

    5

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • kei-ito