Updates to Revenue report.
This commit is contained in:
@@ -145,6 +145,7 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
||||
|
||||
const startDate = new Date(+startTime);
|
||||
const endDate = new Date(+endTime);
|
||||
const unit = getMinimumUnit(startDate, endDate);
|
||||
|
||||
return {
|
||||
startDate,
|
||||
@@ -152,7 +153,7 @@ export function parseDateRange(value: string | object, locale = 'en-US'): DateRa
|
||||
value,
|
||||
...parseDateValue(value),
|
||||
offset: 0,
|
||||
unit: getMinimumUnit(startDate, endDate),
|
||||
unit,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ export function stringToColor(str: string) {
|
||||
}
|
||||
|
||||
export function formatCurrency(value: number, currency: string, locale = 'en-US') {
|
||||
let formattedValue;
|
||||
let formattedValue: Intl.NumberFormat;
|
||||
|
||||
try {
|
||||
formattedValue = new Intl.NumberFormat(locale, {
|
||||
|
||||
@@ -145,6 +145,9 @@ export const utmReportSchema = z.object({
|
||||
|
||||
export const revenueReportSchema = z.object({
|
||||
type: z.literal('revenue'),
|
||||
parameters: z.object({
|
||||
currency: z.string(),
|
||||
}),
|
||||
});
|
||||
|
||||
export const attributionReportSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user