items-by-period (#2)
Reviewed-on: #2 Co-authored-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com> Co-committed-by: Vishesh 'ironeagle' Bangotra <aetoskia@gmail.com>
This commit is contained in:
@@ -4,7 +4,9 @@ export {
|
||||
export type {
|
||||
Transaction,
|
||||
ReportData,
|
||||
ReportBucket,
|
||||
ReportPeriod,
|
||||
GroupKey,
|
||||
} from './report.models'
|
||||
export {
|
||||
prepareReport
|
||||
|
||||
@@ -73,14 +73,11 @@ function buildLabel(
|
||||
end: Date
|
||||
): string {
|
||||
switch (type) {
|
||||
case "weekly":
|
||||
if (sameMonth(start, end)) {
|
||||
const sDay = start.getUTCDate();
|
||||
const eDay = end.getUTCDate();
|
||||
const m = monthFmt.format(start);
|
||||
return `${sDay} ${m} - ${eDay} ${m}`;
|
||||
}
|
||||
return `${dayFmt.format(start)} - ${dayFmt.format(end)}`;
|
||||
case "weekly": {
|
||||
const sDay = start.getUTCDate();
|
||||
const m = monthFmt.format(start);
|
||||
return `${sDay} ${m}`;
|
||||
}
|
||||
|
||||
case "monthly":
|
||||
return `${monthFmt.format(start)} ${yearFmt.format(start)}`;
|
||||
|
||||
Reference in New Issue
Block a user