1.0.1 • Published 6 years ago

@nlib/date-string v1.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@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

1.0.1

6 years ago

1.0.0

6 years ago