mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
加载过程优化
This commit is contained in:
1 parent
bc6426927f
commit
5db23edebb
8 files changed
+74
-58
No files matched your search
@@ -149,10 +149,8 @@ class ContestEditHandler extends ContestDetailHandler {
|
||||
async post({
|
||||
domainId, beginAtDate, beginAtTime, duration, title, content, rule, pids, rated = false,
|
||||
}) {
|
||||
let beginAt;
|
||||
try {
|
||||
beginAt = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
||||
} catch (e) {
|
||||
let beginAt = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
||||
if (!beginAt.isValid()) {
|
||||
throw new ValidationError('beginAtDate', 'beginAtTime');
|
||||
}
|
||||
const endAt = beginAt.clone().add(duration, 'hours').toDate();
|
||||
@@ -288,10 +286,8 @@ class ContestCreateHandler extends ContestHandler {
|
||||
async post({
|
||||
domainId, title, content, rule, beginAtDate, beginAtTime, duration, pids, rated = false,
|
||||
}) {
|
||||
let beginAt;
|
||||
try {
|
||||
beginAt = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
||||
} catch (e) {
|
||||
const beginAt = moment.tz(`${beginAtDate} ${beginAtTime}`, this.user.timeZone);
|
||||
if (!beginAt.isValid()) {
|
||||
throw new ValidationError('beginAtDate', 'beginAtTime');
|
||||
}
|
||||
const endAt = beginAt.clone().add(duration, 'hours');
|
||||
|
||||
Reference in new issue
Block a user