core: remove useless null check

This commit is contained in:
undefined committed 2022-06-03 12:02:45 +08:00
1 parent 5bbc48d4dd
commit 792f1c6266
2 files changed
+2 -3

No files matched your search

+2 -2
View File
@@ -557,13 +557,13 @@ export function isNotStarted(tdoc: Tdoc) {
export function isOngoing(tdoc: Tdoc, tsdoc?: any) {
const now = new Date();
if (tsdoc && tsdoc?.startAt <= new Date(Date.now() - Math.floor(tdoc.duration * Time.hour))) return false;
if (tsdoc && tsdoc.startAt <= new Date(Date.now() - Math.floor(tdoc.duration * Time.hour))) return false;
return (tdoc.beginAt <= now && now < tdoc.endAt);
}
export function isDone(tdoc: Tdoc, tsdoc?: any) {
if (tdoc.endAt <= new Date()) return true;
if (tsdoc && tsdoc?.startAt <= new Date(Date.now() - Math.floor(tdoc.duration * Time.hour))) return true;
if (tsdoc && tsdoc.startAt <= new Date(Date.now() - Math.floor(tdoc.duration * Time.hour))) return true;
return false;
}
Submodule type-challenges deleted from 38f0264f7d.