mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-23 02:28:52 +00:00
potential fix of #65
This commit is contained in:
parent
93b56c0861
commit
c406f883d2
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
## 2.2.1
|
## 2.2.1
|
||||||
|
|
||||||
|
* Potential fix of [#65](https://github.com/InsanusMokrassar/krontab/issues/65)
|
||||||
|
|
||||||
## 2.2.0
|
## 2.2.0
|
||||||
|
|
||||||
* Versions
|
* Versions
|
||||||
|
@ -108,13 +108,19 @@ internal fun NearDateTimeCalculatorDays(
|
|||||||
} else {
|
} else {
|
||||||
dateTime
|
dateTime
|
||||||
})
|
})
|
||||||
dateTime.copy(
|
val newDateTime = dateTime.copy(
|
||||||
dayOfMonth = min(dateTime.month.days(dateTime.year), newOne.toInt() + 1), // index1
|
dayOfMonth = min(dateTime.month.days(dateTime.year), newOne.toInt() + 1), // index1
|
||||||
hour = 0,
|
hour = 0,
|
||||||
minute = 0,
|
minute = 0,
|
||||||
second = 0,
|
second = 0,
|
||||||
milliseconds = 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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user