A utility library that:
- Retrieves military, 12 hr, and 24 hr representations of all times in the day, by an interval of your choice (>= 1 minute)
- Maps a military or 24 hr time to its respective 12 hr time with proper meridiem (AM/PM)
- Retrieves an ordered list of all times of the day, by an interval of your choice (minimum 1 minute)
- Require the Meridiem module
- Create a new Meridiem & initialize by any interval of minutes <= 60 (default = 1)
- Access a time object by passing a String as a key. The string can even have a ':'; it's up to you
- Get an ordered list of all times of the day, by an interval of your choice (>= 1 minute)
var Meridiem = require('meridiem');
var intervalsOf1 = new Meridiem(1);
{
'1000': {
military: '1000',
twelveHr: '10:00 AM',
twentyFourHr: '10:00'
},
'1001': {
military: '1001',
twelveHr: '10:01 AM',
twentyFourHr: '10:01'
},
....
}
//by string key
var tenPM = intervalsOf1.get('2200');
var threeThirtyNineAM = intervalsOf1.get('03:39');
{ military: '2200', twelveHr: '10:00 PM', twentyFourHr: '22:00' }
intervalsOf1List = intervalsOf1.getList();
[
{ military: '0000', twelveHr: '12:00 AM', twentyFourHr: '00:00' },
{ military: '0001', twelveHr: '12:01 AM', twentyFourHr: '00:01' },
...
]