fix(core): update
This commit is contained in:
@ -24,13 +24,12 @@ export class ExtendedDate extends Date {
|
||||
const sliceDate = (dateString: string) => {
|
||||
return `0${dateString}`.slice(-2);
|
||||
};
|
||||
const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(dateArray[1])}T${timeArg}`;
|
||||
const luxonDate = plugins.luxon.DateTime.fromISO(
|
||||
dateTimeString,
|
||||
{
|
||||
zone: zoneArg
|
||||
}
|
||||
);
|
||||
const dateTimeString = `${dateArray[3]}-${sliceDate(dateArray[2])}-${sliceDate(
|
||||
dateArray[1]
|
||||
)}T${timeArg}`;
|
||||
const luxonDate = plugins.luxon.DateTime.fromISO(dateTimeString, {
|
||||
zone: zoneArg
|
||||
});
|
||||
const unixMilli = luxonDate.toMillis();
|
||||
return new ExtendedDate(unixMilli);
|
||||
}
|
||||
|
@ -70,6 +70,14 @@ export class Timer {
|
||||
this.currentTimeout = setTimeout(() => {
|
||||
this.completedDeferred.resolve();
|
||||
}, this.timeLeft);
|
||||
} else {
|
||||
throw new Error('timer has NOT been started before. Please use .start() instead');
|
||||
}
|
||||
}
|
||||
|
||||
public reset() {
|
||||
this.pause();
|
||||
this.startedAt = null;
|
||||
this.pausedAt = null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user