Skip to content

Commit 0dfd415

Browse files
committed
fix(maimai2): fix festa openTime/startTime/resultTime
1 parent 16b0028 commit 0dfd415

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/app/sega/maimai2/maimai2-festa/maimai2-festa.component.html

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ <h5 class="mb-0">
3535
</p>
3636
<p>
3737
<strong>报名选队时间:</strong>
38-
{{
39-
getEventTimeString(
40-
gameFestaInfo.gameFesta.netOpenName.replace("Net", "")
41-
)
42-
}}
38+
{{ getEventTimeString(gameFestaInfo.gameFesta.openEventId) }}
4339
</p>
4440
<p>
4541
<strong>正式开始时间:</strong>
46-
{{ getEventTimeString(gameFestaInfo.gameFesta.openEventId) }}
42+
{{ getEventStartTimeString(gameFestaInfo.gameFesta.openEventId) }}
4743
</p>
4844
<p>
4945
<strong>结束结算时间:</strong>
@@ -175,15 +171,11 @@ <h5 class="mb-0">
175171
</p>
176172
<p>
177173
<strong>报名选队时间:</strong>
178-
{{
179-
getEventTimeString(
180-
gameFestaInfo.gameRsultFesta.netOpenName.replace("Net", "")
181-
)
182-
}}
174+
{{ getEventTimeString(gameFestaInfo.gameRsultFesta.openEventId) }}
183175
</p>
184176
<p>
185177
<strong>正式开始时间:</strong>
186-
{{ getEventTimeString(gameFestaInfo.gameRsultFesta.openEventId) }}
178+
{{ getEventStartTimeString(gameFestaInfo.gameFesta.openEventId) }}
187179
</p>
188180
<p>
189181
<strong>结束结算时间:</strong>

src/app/sega/maimai2/maimai2-festa/maimai2-festa.component.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,15 @@ export class Maimai2FestaComponent implements OnInit {
7373
);
7474
}
7575

76+
getEventStartTimeString(openEventId: string) {
77+
let year = parseInt(openEventId.substring(0, 2), 10);
78+
let month = parseInt(openEventId.substring(2, 4), 10) - 1;
79+
let day = parseInt(openEventId.substring(4, 6), 10);
80+
81+
let result = new Date(new Date(2000 + year, month, day).getTime() + 7 * 24 * 60 * 60 * 1000);
82+
return `${result.getFullYear()}-${(result.getMonth() + 1).toString().padStart(2, '0')}-${result.getDate().toString().padStart(2, '0')}`;
83+
}
84+
7685
loadGameFestaInfo() {
7786
const param = new HttpParams().set('aimeId', this.aimeId);
7887
this.api.get('api/game/maimai2/gameFestaInfo', param).pipe().subscribe(
@@ -119,7 +128,7 @@ export class Maimai2FestaComponent implements OnInit {
119128
async (data: ApiResponse<boolean>) => {
120129
if (data.data) {
121130
this.messageService.toastService.show("队伍投票成功");
122-
131+
123132
if (this.gameFestaInfo.gameFesta)
124133
this.userFestaInfo = await this.loadUserFestaInfo(this.gameFestaInfo.gameFesta);
125134
}

0 commit comments

Comments
 (0)