2.0.1 • Published 8 years ago

timebelt v2.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

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'));