Skip to content

Commit b9c9c6f

Browse files
committed
Fix for Y10k problem
1 parent bbea5d6 commit b9c9c6f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/types/textParsers.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ var arrayParser = require(__dirname + "/arrayParser.js");
33
//parses PostgreSQL server formatted date strings into javascript date objects
44
var parseDate = function(isoDate) {
55
//TODO this could do w/ a refactor
6-
var dateMatcher = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?/;
6+
var dateMatcher = /(\d{1,})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})(\.\d{1,})?/;
77

88
var match = dateMatcher.exec(isoDate);
99
//could not parse date
1010
if(!match) {
11-
dateMatcher = /^(\d{4})-(\d{2})-(\d{2})$/;
11+
dateMatcher = /^(\d{1,})-(\d{2})-(\d{2})$/;
1212
match = dateMatcher.test(isoDate);
1313
if(!match) {
1414
return null;

0 commit comments

Comments
 (0)