fix(05): end of month installments
This commit is contained in:
parent
6ddf3a9030
commit
b55437fa7e
1 changed files with 4 additions and 1 deletions
|
|
@ -165,10 +165,13 @@ function installmentsDate(date: Date | string) {
|
|||
return pay;
|
||||
}
|
||||
|
||||
// Create a new Date object to avoid mutating the original one
|
||||
let updatedDate = new Date(firstPayDateObj);
|
||||
updatedDate.setMonth(updatedDate.getMonth() + index);
|
||||
|
||||
if (updatedDate.getDate() !== firstPayDateObj.getDate()) {
|
||||
updatedDate.setDate(0);
|
||||
}
|
||||
|
||||
return {
|
||||
...pay,
|
||||
date: updatedDate.toISOString(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue