chore: handle calendar date range in frontend (#2277)

This commit is contained in:
Aaryan Khandelwal 2023-09-27 14:41:32 +05:30 committed by GitHub
parent 5298f1e53c
commit b3be363b00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 208 additions and 325 deletions

View file

@ -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();