mirror of
https://activitypub.software/TransFem-org/Sharkey
synced 2024-11-22 14:05:12 +00:00
Refactor: Better arg name
This commit is contained in:
parent
8946f3ea18
commit
49a5b4eb14
1 changed files with 4 additions and 4 deletions
|
@ -381,7 +381,7 @@ export default abstract class Chart<T extends Record<string, any>> {
|
|||
}
|
||||
|
||||
@autobind
|
||||
public async getChart(span: Span, range: number, offset: number, group: string | null = null): Promise<ArrayValue<T>> {
|
||||
public async getChart(span: Span, amount: number, offset: number, group: string | null = null): Promise<ArrayValue<T>> {
|
||||
let [y, m, d, h] = Chart.getCurrentDate();
|
||||
|
||||
let lt: Date = null as never;
|
||||
|
@ -396,8 +396,8 @@ export default abstract class Chart<T extends Record<string, any>> {
|
|||
}
|
||||
|
||||
const gt =
|
||||
span === 'day' ? subtractTimespan(DateUTC([y, m, d]), range - 1, 'day') :
|
||||
span === 'hour' ? subtractTimespan(DateUTC([y, m, d, h]), range - 1, 'hour') :
|
||||
span === 'day' ? subtractTimespan(DateUTC([y, m, d]), amount - 1, 'day') :
|
||||
span === 'hour' ? subtractTimespan(DateUTC([y, m, d, h]), amount - 1, 'hour') :
|
||||
null as never;
|
||||
|
||||
// ログ取得
|
||||
|
@ -453,7 +453,7 @@ export default abstract class Chart<T extends Record<string, any>> {
|
|||
const chart: T[] = [];
|
||||
|
||||
// 整形
|
||||
for (let i = (range - 1); i >= 0; i--) {
|
||||
for (let i = (amount - 1); i >= 0; i--) {
|
||||
const current =
|
||||
span == 'day' ? subtractTimespan(DateUTC([y, m, d]), i, 'day') :
|
||||
span == 'hour' ? subtractTimespan(DateUTC([y, m, d, h]), i, 'hour') :
|
||||
|
|
Loading…
Reference in a new issue