diff options
Diffstat (limited to 'shared/src')
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt | 6 | ||||
-rw-r--r-- | shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt index 9a16615..5286b46 100644 --- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/client/models/Position.kt @@ -46,11 +46,11 @@ data class Position ( val deviceId: Int? = null, val protocol: String? = null, /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ -// val deviceTime: LocalDateTime? = null, + val deviceTime: String? = null, /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ -// val fixTime: LocalDateTime? = null, + val fixTime: String? = null, /* in IS0 8601 format. eg. `1963-11-22T18:30:00Z` */ -// val serverTime: LocalDateTime? = null, + val serverTime: String? = null, val outdated: Boolean? = null, val valid: Boolean? = null, val latitude: Double? = null, diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt new file mode 100644 index 0000000..133c028 --- /dev/null +++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/utils/Formatter.kt @@ -0,0 +1,12 @@ +package mx.trackermap.TrackerMap.utils + +import kotlinx.datetime.* + +class Formatter { + companion object { + fun formatDate(date: String): String { + return date.substring(0 until date.indexOf('+')) + .toLocalDateTime().toString().replace('T', ' ') + } + } +}
\ No newline at end of file |