timebelt
v2.0.1
Published
Timezone aware date formatting
Downloads
6
Readme
timebelt
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'));