-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing bugs, improving error reporting.
- Loading branch information
1 parent
08fdca5
commit c6ba2cd
Showing
3 changed files
with
77 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
export const isExam = ({ privateData: { examBegin, examEnd } }) => { | ||
import { safeGet } from './common'; | ||
|
||
export const isExam = group => { | ||
const examBegin = safeGet(group, ['privateData', 'examBegin']); | ||
const examEnd = safeGet(group, ['privateData', 'examEnd']); | ||
const now = Date.now() / 1000; | ||
return examBegin && examEnd && examEnd > now && examBegin <= now; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters