chore: handle calendar date range in frontend (#2277)
This commit is contained in:
parent
5298f1e53c
commit
b3be363b00
7 changed files with 208 additions and 325 deletions
|
|
@ -112,18 +112,6 @@ export const formatDate = (date: Date, format: string): string => {
|
|||
return formattedDate;
|
||||
};
|
||||
|
||||
export const subtractMonths = (date: Date, numMonths: number) => {
|
||||
const result = new Date(date);
|
||||
result.setMonth(result.getMonth() - numMonths);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const addMonths = (date: Date, numMonths: number) => {
|
||||
const result = new Date(date);
|
||||
result.setMonth(result.getMonth() + numMonths);
|
||||
return result;
|
||||
};
|
||||
|
||||
export const updateDateWithYear = (yearString: string, date: Date) => {
|
||||
const year = parseInt(yearString);
|
||||
const month = date.getMonth();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue