fix const
This commit is contained in:
@@ -137,13 +137,16 @@ export class SMDate {
|
|||||||
const parsedDay = parseInt(day.padStart(2, "0"), 10);
|
const parsedDay = parseInt(day.padStart(2, "0"), 10);
|
||||||
const parsedMonth = this.getMonthAsNumber(month);
|
const parsedMonth = this.getMonthAsNumber(month);
|
||||||
const parsedYear = parseInt(year.padStart(4, "20"), 10);
|
const parsedYear = parseInt(year.padStart(4, "20"), 10);
|
||||||
|
let parsedHours: number = 0,
|
||||||
|
parsedMinutes: number = 0,
|
||||||
|
parsedSeconds: number = 0;
|
||||||
|
|
||||||
const parsedTime = timeRegex.exec(time);
|
const parsedTime = timeRegex.exec(time);
|
||||||
if (time && parsedTime) {
|
if (time && parsedTime) {
|
||||||
const [_, hourStr, minuteStr, secondStr, ampm] = parsedTime;
|
const [_, hourStr, minuteStr, secondStr, ampm] = parsedTime;
|
||||||
let parsedHours = parseInt(hourStr);
|
parsedHours = parseInt(hourStr);
|
||||||
const parsedMinutes = parseInt(minuteStr || "0");
|
parsedMinutes = parseInt(minuteStr || "0");
|
||||||
const parsedSeconds = parseInt(secondStr || "0");
|
parsedSeconds = parseInt(secondStr || "0");
|
||||||
|
|
||||||
if (parsedHours < 0 || parsedHours > 23) {
|
if (parsedHours < 0 || parsedHours > 23) {
|
||||||
return this;
|
return this;
|
||||||
|
|||||||
Reference in New Issue
Block a user