Skip to content

Commit 4bc980a

Browse files
committed
Eliminate compiler warnings
1 parent 4bd6cae commit 4bc980a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/kotlin/dev/vxrp/bot/regulars/handler/RegularsCheckerHandler.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import kotlinx.coroutines.delay
3232
import net.dv8tion.jda.api.JDA
3333
import org.slf4j.LoggerFactory
3434
import java.time.LocalDate
35+
import java.time.format.DateTimeFormatter
3536
import kotlin.math.sqrt
3637
import kotlin.time.Duration.Companion.seconds
3738

@@ -111,7 +112,8 @@ class RegularsCheckerHandler(val api: JDA, val config: Config, val translation:
111112
}
112113

113114
private fun checkPlaytime(regular: RegularDatabaseEntry, steamId: String, lastCheckedDate: LocalDate?): Boolean {
114-
if (lastCheckedDate == LocalDate.now()) return false
115+
val formatter = DateTimeFormatter.ofPattern("dd.MM.yyyy")
116+
if (lastCheckedDate?.format(formatter) == LocalDate.now().format(formatter)) return false
115117
val cedmod = Cedmod(config.settings.cedmod.instance, config.settings.cedmod.api)
116118

117119
try {

0 commit comments

Comments
 (0)