timeofday-parser
This is a simple script to parse a string containing a time of day into a known format. It accepts every reasonable english language time format I could think of.
Install
npm install timeofday-parser
Usage
var timeParser = ; output = timeParser;// {h: 21, m: 6} output = timeParser;// false
Examples
9 {"h":9,"m":0}
9am {"h":9,"m":0}
9p {"h":21,"m":0}
926 {"h":9,"m":26}
0926 {"h":9,"m":26}
2126 {"h":21,"m":26}
9:26pm {"h":21,"m":26}
9.26 am {"h":9,"m":26}
9.26 pm {"h":21,"m":26}
926pm {"h":21,"m":26}
0926am {"h":9,"m":26}
926p {"h":21,"m":26}
9,26 {"h":9,"m":26}
9260 false
26:90 false
26pm false