@fedeghe/validatedate
v0.0.5
Published
Two straight functions both returning a boolean to check the validity of a string date against a format.
Downloads
2
Readme
validatedate
Two straight functions both returning a boolean to check the validity of a string date against a format.
const {
isValidDate,
isValidFormat
} = require('validatedate'),
dateValidity= isValidDate(
'12-13-2013',
'MM-DD-YYYY', // def= YYYY-MM-dd
['-'], // def= ["/","-","."]
['YYYY', 'YY', 'MM', 'DD'] // def= $defaults.pleaceholders$
),
formatValidity= isValidFormat(
'MM-DD-YYYY', // def= YYYY-MM-dd
['-'], // def= ["/","-","."]
['YYYY', 'YY', 'MM', 'DD'] // def= $defaults.pleaceholders$
);
15/6/2024