lydavid / MusicSearch

An Android app for browsing songs, artists, and anything related to them
https://lydavid.github.io/MusicSearch/
Apache License 2.0
35 stars 0 forks source link

confirm this #850

Closed github-actions[bot] closed 3 months ago

github-actions[bot] commented 6 months ago

https://github.com/lydavid/MusicSearch/blob/fcda8269a393abde17b5c5401945461b4ff07174/core/models/src/iosMain/kotlin/ly/david/musicsearch/core/models/common/DateExt.ios.kt#L17


package ly.david.musicsearch.core.models.common

import kotlinx.datetime.Instant
import kotlinx.datetime.toNSDate
import platform.Foundation.NSDateFormatter

actual fun Instant.getDateFormatted(): String {
    val dateFormatter = NSDateFormatter()
    dateFormatter.dateFormat = DATE_FORMAT
    return dateFormatter.stringFromDate(
        toNSDate()
    )
}

actual fun Instant.getTimeFormatted(): String {
    val dateFormatter = NSDateFormatter()
    // TODO: confirm this
    dateFormatter.dateFormat = TIME_FORMAT
    return dateFormatter.stringFromDate(
        toNSDate()
    )
}
github-actions[bot] commented 3 months ago

Closed in d06cade40b958ca08423cc4eec73ea7662816b3c