mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 18:03:08 +02:00
Fix chart engine
This commit is contained in:
parent
5d3d78a73e
commit
2ceaccf9ab
1 changed files with 4 additions and 4 deletions
|
@ -241,8 +241,8 @@ export default abstract class Chart<T> {
|
||||||
const [y, m, d, h] = this.getCurrentDate();
|
const [y, m, d, h] = this.getCurrentDate();
|
||||||
|
|
||||||
const gt =
|
const gt =
|
||||||
span == 'day' ? utc([y, m, d - range]) :
|
span == 'day' ? utc([y, m, d]).subtract(range, 'days') :
|
||||||
span == 'hour' ? utc([y, m, d, h - range]) :
|
span == 'hour' ? utc([y, m, d, h]).subtract(range, 'hours') :
|
||||||
null;
|
null;
|
||||||
|
|
||||||
// ログ取得
|
// ログ取得
|
||||||
|
@ -285,8 +285,8 @@ export default abstract class Chart<T> {
|
||||||
// 整形
|
// 整形
|
||||||
for (let i = (range - 1); i >= 0; i--) {
|
for (let i = (range - 1); i >= 0; i--) {
|
||||||
const current =
|
const current =
|
||||||
span == 'day' ? utc([y, m, d - i]) :
|
span == 'day' ? utc([y, m, d]).subtract(i, 'days') :
|
||||||
span == 'hour' ? utc([y, m, d, h - i]) :
|
span == 'hour' ? utc([y, m, d, h]).subtract(i, 'hours') :
|
||||||
null;
|
null;
|
||||||
|
|
||||||
const log = logs.find(l => utc(l.date).isSame(current));
|
const log = logs.find(l => utc(l.date).isSame(current));
|
||||||
|
|
Loading…
Reference in a new issue