0.6.0 • Published 10 years ago

till-when v0.6.0

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

Till-when

Till-when takes a time range string (like "9-2P") and converts it into formatted begin and end components.

Usage

Install via npm:

npm install till-when --save
var tillwhen = require('till-when')

var parsed = tillwhen.parse('9AM-11:11AM');
console.log(parsed.begin); //'9:00 AM'
console.log(parsed.end); //'11:11 AM'

parsed = tillwhen.parse('8A to 7PM');
console.log(parsed.begin); //'8:00 AM'
console.log(parsed.end); //'7:00 PM'

//if missing, the AM/PM of the beginning time is inferred from the end
parsed = tillwhen.parse('9-2P');
console.log(parsed.begin); //'9:00 AM'
console.log(parsed.end); //'2:00 PM'

Tests

Tests are written in mocha/chai.expect.

0.6.0

10 years ago

0.5.1

10 years ago

0.5.0

10 years ago