mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
linting error fix
This commit is contained in:
parent
84928e6371
commit
1e50f1b2e5
@ -224,7 +224,7 @@ export class Utils {
|
||||
//this function makes sure that if date is the 31st and you add a month, you will get the last day of the next month
|
||||
//so adding or subtracting a month from 31st of march will give 30th of april or 28th of february respectively (29th on leap years).
|
||||
static addMonthToDate(date: Date, numMonths: number) {
|
||||
let result = new Date(date)
|
||||
const result = new Date(date)
|
||||
const expectedMonth = ((date.getMonth() + numMonths) % 12 + 12) % 12; //inner %12 + 12 makes correct handling of negative months
|
||||
result.setMonth(result.getMonth() + numMonths);
|
||||
if (result.getMonth() !== expectedMonth) {
|
||||
|
Loading…
Reference in New Issue
Block a user