0.1.0 • Published 9 years ago
is-time v0.1.0
is-time
Check if a string is a time value
About
is-time provides a simple function which can be used to test if a value resembles a time.
Installation is easy:
npm install is-time --save
# or
yarn add is-timeUsage
Once imported, simply pass a string value to isTime. Non-string values will throw exceptions.
const isTime = require("is-time");
isTime("23:43:12+0100"); // true
isTime("12:36:23.237 AM"); // true
isTime("03:71:02 a.m."); // false
isTime(""); // false
isTime({}); // error0.1.0
9 years ago