timebelt

2.0.1 • Public • Published

timebelt Build Status

Timezone aware date formatting.

Usage

import {dayRange, format, setUserTimezone} from 'timebelt';

// Set the user's timezone
setUserTimezone('America/New_York');

// Jan 1 2016 12:00 AM - 11:59 PM EST
const range = dayRange(new Date('2016-01-01T18:00:00.000Z'));

// In San Francisco it will print 12:00am - 11:59pm EST
// In New York it will print 12:00am - 11:59pm
console.log(format([range.start, range.end], 'h:mma'));

Readme

Keywords

none

Package Sidebar

Install

npm i timebelt

Weekly Downloads

0

Version

2.0.1

License

MIT

Last publish

Collaborators

  • derekcaneja
  • jperl