mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: remove useless null check
This commit is contained in:
1 parent
5bbc48d4dd
commit
792f1c6266
2 files changed
+2
-3
No files matched your search
@@ -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.
Reference in new issue
Block a user