potential fix of #65

This commit is contained in:
InsanusMokrassar committed 2023-10-23 01:26:17 +06:00
1 parent 58375452c7
commit d64acc9806
2 files changed
+9 -1

No files matched your search

@@ -108,13 +108,19 @@ internal fun NearDateTimeCalculatorDays(
} else {
dateTime
})
dateTime.copy(
val newDateTime = dateTime.copy(
dayOfMonth = min(dateTime.month.days(dateTime.year), newOne.toInt() + 1), // index1
hour = 0,
minute = 0,
second = 0,
milliseconds = 0
)
// If day of month has not been changed, use old dateTime due to no changes required
if (newDateTime.dayOfMonth == dateTime.dayOfMonth) {
dateTime
} else {
newDateTime
}
}
)