major refactor of the dashboard and react-openapi integration #1
@@ -83,10 +83,7 @@ function buildLabel(
|
||||
return `${dayFmt.format(start)} - ${dayFmt.format(end)}`;
|
||||
|
||||
case "monthly":
|
||||
if (sameMonth(start, end)) {
|
||||
return `${monthFmt.format(start)} ${yearFmt.format(start)}`;
|
||||
}
|
||||
return `${monthDayFmt.format(start)} - ${monthDayFmt.format(end)}`;
|
||||
return `${monthFmt.format(start)} ${yearFmt.format(start)}`;
|
||||
|
||||
case "yearly":
|
||||
return yearFmt.format(start);
|
||||
@@ -110,8 +107,8 @@ function decoratePeriods(
|
||||
): (ReportPeriod & { id: string; label: string })[] {
|
||||
return periods.map((p) => ({
|
||||
...p,
|
||||
id: buildPeriodId(type, new Date(p.start), new Date(p.end)),
|
||||
label: buildLabel(type, new Date(p.start), new Date(p.end)),
|
||||
id: buildPeriodId(type, new Date(p.start + "Z"), new Date(p.end + "Z")),
|
||||
label: buildLabel(type, new Date(p.start + "Z"), new Date(p.end + "Z")),
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user