Skip to content

Commit

Permalink
Add locale to iOS date formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
msasikanth committed Oct 16, 2023
1 parent 0f77eef commit 6ab15f4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,14 @@ import io.github.aakira.napier.Napier
import io.ktor.http.Url
import io.sentry.kotlin.multiplatform.Sentry
import platform.Foundation.NSDateFormatter
import platform.Foundation.NSLocale
import platform.Foundation.timeIntervalSince1970

private val atomDateFormatter = NSDateFormatter().apply { dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ" }
private val atomDateFormatter =
NSDateFormatter().apply {
dateFormat = "yyyy-MM-dd'T'HH:mm:ssZ"
locale = NSLocale("en_US_POSIX")
}

internal fun PostPayload.Companion.mapAtomPost(
atomMap: Map<String, String>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,19 @@ import io.github.aakira.napier.Napier
import io.ktor.http.Url
import io.sentry.kotlin.multiplatform.Sentry
import platform.Foundation.NSDateFormatter
import platform.Foundation.NSLocale
import platform.Foundation.timeIntervalSince1970

private val offsetTimezoneDateFormatter =
NSDateFormatter().apply { dateFormat = "E, d MMM yyyy HH:mm:ss Z" }
NSDateFormatter().apply {
dateFormat = "E, d MMM yyyy HH:mm:ss Z"
locale = NSLocale("en_US_POSIX")
}
private val abbrevTimezoneDateFormatter =
NSDateFormatter().apply { dateFormat = "E, d MMM yyyy HH:mm:ss z" }
NSDateFormatter().apply {
dateFormat = "E, d MMM yyyy HH:mm:ss z"
locale = NSLocale("en_US_POSIX")
}

internal fun PostPayload.Companion.mapRssPost(
rssMap: Map<String, String>,
Expand Down

0 comments on commit 6ab15f4

Please sign in to comment.