music: add support for date-encoding years

Add support for date-encoding years such as "YYYYMMDD".

This is a semi-common timestamp edge-case, it seems, primarily due to
taggers wanting to encode date information in older tag formats.
This commit is contained in:
Alexander Capehart
2023-01-06 13:47:18 -07:00
parent a29875b5bf
commit 3502af33e7
4 changed files with 28 additions and 8 deletions
@@ -124,6 +124,12 @@ class DateTest {
assertEquals(Date.from(0), null)
}
@Test
fun date_fromYearDate() {
assertEquals("2016", Date.from(2016).toString())
assertEquals("2016", Date.from("2016").toString())
}
@Test
fun dateRange_fromDates() {
val range =