Merge pull request #77 from InsanusMokrassar/2.2.1

2.2.1
This commit is contained in:
InsanusMokrassar 2023-09-18 14:51:17 +06:00 committed by GitHub
commit b9f24c979a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 7 deletions

View File

@ -1,5 +1,13 @@
# Changelog # Changelog
## 2.2.1
* Potential fix of [#65](https://github.com/InsanusMokrassar/krontab/issues/65)
* Versions
* `Kotlin`: `1.9.20-Beta`
* `Klock`: `4.0.10`
* `Serialization`: `1.6.0`
## 2.2.0 ## 2.2.0
* Versions * Versions

View File

@ -9,13 +9,13 @@ android.useAndroidX=true
android.enableJetifier=false android.enableJetifier=false
kotlin_version=1.9.0 kotlin_version=1.9.20-Beta
kotlin_coroutines_version=1.7.3 kotlin_coroutines_version=1.7.3
kotlin_serialization_version=1.5.1 kotlin_serialization_version=1.6.0
dokka_version=1.8.20 dokka_version=1.9.0
klockVersion=4.0.9 klockVersion=4.0.10
## Github reease ## Github reease
@ -36,5 +36,5 @@ androidx_work_version=2.8.1
## Common ## Common
version=2.2.0 version=2.2.1
android_code_version=30 android_code_version=31

View File

@ -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
}
} }
) )