Fix compilation error on iOS

This commit is contained in:
Olof Hedman
2025-10-14 18:59:04 +02:00
parent e81abae275
commit e0a6739623

View File

@@ -43,7 +43,7 @@ actual fun parseIsoToEpochMsOrNull(iso: String?): Long? {
val fmt = NSDateFormatter().apply { val fmt = NSDateFormatter().apply {
dateFormat = "yyyy-MM-dd HH:mm:ss" dateFormat = "yyyy-MM-dd HH:mm:ss"
locale = NSLocale.localeWithLocaleIdentifier("en_US_POSIX") locale = NSLocale.localeWithLocaleIdentifier("en_US_POSIX")
timeZone = NSTimeZone.timeZoneWithAbbreviation("UTC") timeZone = NSTimeZone.timeZoneWithAbbreviation("UTC")!!
} }
val s = iso.replace('T', ' ').removeSuffix("Z") val s = iso.replace('T', ' ').removeSuffix("Z")
val d: NSDate? = fmt.dateFromString(s) val d: NSDate? = fmt.dateFromString(s)