Commit a1bbd10c authored by 神楽坂玲奈's avatar 神楽坂玲奈

修复匹配时间显示的半时区问题

parent d4f06b95
{ {
"name": "mycard-mobile", "name": "mycard-mobile",
"version": "1.0.14", "version": "1.0.15",
"license": "UNLISENCED", "license": "UNLISENCED",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
......
...@@ -4,9 +4,9 @@ import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material'; ...@@ -4,9 +4,9 @@ import { MD_DIALOG_DATA, MdDialogRef } from '@angular/material';
import { Observable } from 'rxjs/Observable'; import { Observable } from 'rxjs/Observable';
import { Subscription } from 'rxjs/Subscription'; import { Subscription } from 'rxjs/Subscription';
import { LoginService } from '../login.service'; import { LoginService } from '../login.service';
import { YGOProService } from '../ygopro.service';
const second = 1000; const second = 1000;
const offset = new Date().getTimezoneOffset() * 60 * second;
@Component({ @Component({
selector: 'app-match', selector: 'app-match',
...@@ -15,8 +15,8 @@ const second = 1000; ...@@ -15,8 +15,8 @@ const second = 1000;
}) })
export class MatchDialog implements OnInit, OnDestroy { export class MatchDialog implements OnInit, OnDestroy {
expect_wait = this.http.get('https://api.mycard.moe/ygopro/match/stats/' + this.arena).map(response => response.json() * second); expect_wait = this.http.get('https://api.mycard.moe/ygopro/match/stats/' + this.arena).map(response => response.json() * second + offset);
actual_wait = Observable.timer(0, second).map(timestamp => timestamp * second); actual_wait = Observable.timer(0, second).map(timestamp => timestamp * second + offset);
matching: Subscription; matching: Subscription;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment