Skip to content

johnjago/is-am-pm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

is-am-pm

Build Status

Check whether it's a.m. or p.m. in local time. When given a number n, it is assumed that 0 <= n <= 23, which is the hour of the day on a 24-hour clock. Behavior is undefined for values of n outside that range.

Compatible with Node.js 8 or higher.

Usage

import { isAM, isPM } from 'is-am-pm';

isAM(new Date('1995-12-17T03:24:00')); // true
isPM(20); // true
isPM(8); // false

License

MIT