mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: fix contest_edit timezone convert
This commit is contained in:
1 parent
0c587d1786
commit
c00c2160ec
7 files changed
+22
-23
No files matched your search
@@ -293,12 +293,13 @@ export class ContestEditHandler extends Handler {
|
||||
}
|
||||
let ts = Date.now();
|
||||
ts = ts - (ts % (15 * Time.minute)) + 15 * Time.minute;
|
||||
const beginAt = moment(this.tdoc?.beginAt || new Date(ts)).tz(this.user.timeZone);
|
||||
this.response.body = {
|
||||
rules,
|
||||
tdoc: this.tdoc,
|
||||
duration: tid ? (this.tdoc.endAt.getTime() - this.tdoc.beginAt.getTime()) / Time.hour : 2,
|
||||
duration: tid ? -beginAt.diff(this.tdoc.endAt, 'hour', true) : 2,
|
||||
pids: tid ? this.tdoc.pids.join(',') : '',
|
||||
beginAt: this.tdoc?.beginAt || new Date(ts),
|
||||
beginAt,
|
||||
page_name: tid ? 'contest_edit' : 'contest_create',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user