From 99ec25bbb6f410ae33f09ee75ae005f5ffcdffcf Mon Sep 17 00:00:00 2001 From: Justin Wernick Date: Sun, 11 Jun 2023 22:47:41 +0200 Subject: Update the docs which incorrectly had a 1-indexed month --- south-african-id-parser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'south-african-id-parser.js') diff --git a/south-african-id-parser.js b/south-african-id-parser.js index 62f5e15..983647a 100644 --- a/south-african-id-parser.js +++ b/south-african-id-parser.js @@ -52,7 +52,7 @@ * var info = saIdParser.parse(validIdNumber); * // info === { * // isValid: true, - * // dateOfBirth: new Date(1990, 01, 04), + * // dateOfBirth: new Date(1990, 0, 4), * // isMale: true, * // isFemale: false, * // isSouthAfricanCitizen: true @@ -103,6 +103,9 @@ * December 2015. If, on the other hand, the date of birth is parsed as 11 * December 15, that will be interpreted as 10 December 1915. * + * The date will be in the local timezone, with the time portion set to + * midnight. + * * @function * @param {string} idNumber - The ID number to be parsed. * @return {?Date} The date of birth from the ID number, or undefined if the @@ -114,7 +117,7 @@ * var validIdNumber = '9001049818080'; * var dateOfBirth = saIdParser.parseDateOfBirth(validIdNumber); * - * // dateOfBirth === new Date(1990, 01, 04) + * // dateOfBirth === new Date(1990, 0, 4) */ parseDateOfBirth: parseDateOfBirth, -- cgit v1.2.3