Comparing version
@@ -11,3 +11,3 @@ "use strict"; | ||
this.timezone = timezone; | ||
this.parts = buidDateParts(date, timezone); | ||
this.parts = buildDateParts(date, timezone); | ||
} | ||
@@ -33,7 +33,7 @@ toDate() { | ||
this.timestamp = newDate.getTime(); | ||
this.parts = buidDateParts(newDate, this.timezone); | ||
this.parts = buildDateParts(newDate, this.timezone); | ||
} | ||
} | ||
exports.LocalizedTime = LocalizedTime; | ||
function buidDateParts(date, timezone) { | ||
function buildDateParts(date, timezone) { | ||
const dftOptions = { | ||
@@ -64,3 +64,3 @@ year: 'numeric', | ||
year: parseInt(parts.year), | ||
hour: parseInt(parts.hour), | ||
hour: parts.hour === '24' ? 0 : parseInt(parts.hour), | ||
minute: parseInt(parts.minute), | ||
@@ -67,0 +67,0 @@ second: parseInt(parts.second), |
@@ -39,3 +39,5 @@ "use strict"; | ||
date.set('second', nextSecond); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -47,3 +49,5 @@ date.set('second', seconds[0]); | ||
date.set('minute', nextMinute); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -55,3 +59,5 @@ date.set('minute', minutes[0]); | ||
date.set('hour', nextHour); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -63,3 +69,5 @@ date.set('hour', hours[0]); | ||
date.set('day', nextDay); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -71,3 +79,5 @@ date.set('day', days[0]); | ||
date.set('month', nextMonth); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -74,0 +84,0 @@ date.set('year', date.getParts().year + 1); |
@@ -11,3 +11,3 @@ "use strict"; | ||
this.timezone = timezone; | ||
this.parts = buidDateParts(date, timezone); | ||
this.parts = buildDateParts(date, timezone); | ||
} | ||
@@ -33,7 +33,7 @@ toDate() { | ||
this.timestamp = newDate.getTime(); | ||
this.parts = buidDateParts(newDate, this.timezone); | ||
this.parts = buildDateParts(newDate, this.timezone); | ||
} | ||
} | ||
exports.LocalizedTime = LocalizedTime; | ||
function buidDateParts(date, timezone) { | ||
function buildDateParts(date, timezone) { | ||
const dftOptions = { | ||
@@ -64,3 +64,3 @@ year: 'numeric', | ||
year: parseInt(parts.year), | ||
hour: parseInt(parts.hour), | ||
hour: parts.hour === '24' ? 0 : parseInt(parts.hour), | ||
minute: parseInt(parts.minute), | ||
@@ -67,0 +67,0 @@ second: parseInt(parts.second), |
@@ -39,3 +39,5 @@ "use strict"; | ||
date.set('second', nextSecond); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -47,3 +49,5 @@ date.set('second', seconds[0]); | ||
date.set('minute', nextMinute); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -55,3 +59,5 @@ date.set('minute', minutes[0]); | ||
date.set('hour', nextHour); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -63,3 +69,5 @@ date.set('hour', hours[0]); | ||
date.set('day', nextDay); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -71,3 +79,5 @@ date.set('day', days[0]); | ||
date.set('month', nextMonth); | ||
return date; | ||
if (this.timeMatcher.match(date.toDate())) { | ||
return date; | ||
} | ||
} | ||
@@ -74,0 +84,0 @@ date.set('year', date.getParts().year + 1); |
{ | ||
"name": "node-cron", | ||
"version": "4.0.5", | ||
"version": "4.0.6", | ||
"description": "A Lightweight Task Scheduler for Node.js", | ||
@@ -5,0 +5,0 @@ "author": "Lucas Merencia", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
217926
0.87%3165
0.64%