forked from Louvorg/ReaderForSelfoss-multiplatform
fix: Another date format thing.
This commit is contained in:
@ -13,6 +13,8 @@ class DatesTest {
|
||||
private val oldVersionDate = "2013-05-07 13:46:00"
|
||||
private val oldVersionDateVariant = "2021-03-21 10:32:00.000000"
|
||||
|
||||
private val bugVersionDate = "2023-12-19T10:30:53-05:00"
|
||||
|
||||
@Test
|
||||
fun new_version_date_should_be_parsed() {
|
||||
val date = DateUtils.parseDate(newVersionDate)
|
||||
@ -52,4 +54,14 @@ class DatesTest {
|
||||
|
||||
assertEquals(expected, date)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun bug_version_variant_date_should_be_parsed() {
|
||||
val date = DateUtils.parseDate(bugVersionDate)
|
||||
val expected =
|
||||
LocalDateTime(1991, 3, 18, 3, 0, 0, 0).toInstant(TimeZone.currentSystemDefault())
|
||||
.toEpochMilliseconds()
|
||||
|
||||
assertEquals(expected, date)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user