Logbook event date edit

This commit is contained in:
2025-04-23 08:58:32 +02:00
parent 4c5c7bcf1a
commit 0d3be20e1e
6 changed files with 47 additions and 37 deletions

View File

@@ -11,7 +11,7 @@ import java.util.Date
* allow expandability and backwards compatibility (if a field is added in a
* release, it is simply ignored by previous ones).
*/
class LunaEvent {
class LunaEvent: Comparable<LunaEvent> {
companion object {
val TYPE_BABY_BOTTLE = "BABY_BOTTLE"
@@ -130,4 +130,8 @@ class LunaEvent {
override fun toString(): String {
return "${type} qty: $quantity time: ${Date(time * 1000)}"
}
override fun compareTo(other: LunaEvent): Int {
return (this.time - other.time).toInt()
}
}