feat(ssr): previous calendar year period + external register filters
- P&L period dropdown: replace "Calendar year (YYYY)" with "Previous Calendar Year (YYYY-1)" pulling the full prior year - External register: title now reads "External Register"; add Source, External Id, and Location filters Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -268,6 +268,21 @@ const calendarYearPeriod = (date) => {
|
||||
return {end: formatDateMMDDYYYY(end), start: formatDateMMDDYYYY(start)};
|
||||
}
|
||||
|
||||
const previousCalendarYearPeriod = (date) => {
|
||||
if (!date) {
|
||||
date= new Date()
|
||||
} else {
|
||||
date = parseMMDDYYYY(date)
|
||||
}
|
||||
const priorYear = date.getFullYear() - 1;
|
||||
|
||||
// Jan 1 - Dec 31 of the previous calendar year
|
||||
const start = new Date(priorYear, 0, 1);
|
||||
const end = new Date(priorYear, 11, 31);
|
||||
|
||||
return {end: formatDateMMDDYYYY(end), start: formatDateMMDDYYYY(start)};
|
||||
}
|
||||
|
||||
const getLastMonthPeriods = (date) => {
|
||||
if (!date) {
|
||||
date = new Date();
|
||||
|
||||
Reference in New Issue
Block a user