|
|
@ -39,14 +39,14 @@ export class CurrentRateService { |
|
|
subscriptionType |
|
|
subscriptionType |
|
|
}: GetValuesParams): Promise<GetValuesObject> { |
|
|
}: GetValuesParams): Promise<GetValuesObject> { |
|
|
const dataProviderInfos: DataProviderInfo[] = []; |
|
|
const dataProviderInfos: DataProviderInfo[] = []; |
|
|
|
|
|
const today = resetHours(new Date()); |
|
|
|
|
|
|
|
|
const includesToday = |
|
|
const includesToday = |
|
|
(!dateQuery.lt || isBefore(new Date(), dateQuery.lt)) && |
|
|
(!dateQuery.lt || isBefore(new Date(), dateQuery.lt)) && |
|
|
(!dateQuery.gte || isBefore(dateQuery.gte, new Date())) && |
|
|
(!dateQuery.gte || isBefore(dateQuery.gte, new Date())) && |
|
|
(!dateQuery.in || this.containsToday(dateQuery.in)); |
|
|
(!dateQuery.in || this.containsToday({ today, dates: dateQuery.in })); |
|
|
|
|
|
|
|
|
const quoteErrors: ResponseError['errors'] = []; |
|
|
const quoteErrors: ResponseError['errors'] = []; |
|
|
const today = resetHours(new Date()); |
|
|
|
|
|
const values: GetValueObject[] = []; |
|
|
const values: GetValueObject[] = []; |
|
|
|
|
|
|
|
|
if (includesToday) { |
|
|
if (includesToday) { |
|
|
@ -191,14 +191,15 @@ export class CurrentRateService { |
|
|
return response; |
|
|
return response; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private containsToday(dates: Date[]): boolean { |
|
|
private containsToday({ |
|
|
const today = resetHours(new Date()); |
|
|
dates, |
|
|
|
|
|
today |
|
|
for (const date of dates) { |
|
|
}: { |
|
|
if (isSameDay(date, today, { in: utc })) { |
|
|
dates: Date[]; |
|
|
return true; |
|
|
today: Date; |
|
|
} |
|
|
}): boolean { |
|
|
} |
|
|
return dates.some((date) => { |
|
|
return false; |
|
|
return isSameDay(date, today, { in: utc }); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|