19 lines
689 B
Kotlin
19 lines
689 B
Kotlin
package database
|
|
|
|
import java.time.LocalDate
|
|
import java.time.LocalTime
|
|
import java.time.format.DateTimeFormatter
|
|
|
|
data class LogSemiauto(val index: ULong, val date: String, val time: String, val source: String, val description: String){
|
|
override fun toString(): String {
|
|
return "$date $time [$source] $description"
|
|
}
|
|
companion object{
|
|
fun NewLog(source: String, description: String): LogSemiauto {
|
|
val date = LocalDate.now().format(DateTimeFormatter.ofPattern("dd/MM/yyyy"))
|
|
val time = LocalTime.now().format(DateTimeFormatter.ofPattern("HH:mm:ss"))
|
|
return LogSemiauto(0u, date, time, source, description)
|
|
}
|
|
}
|
|
}
|