Commit f9ba341d authored by Jonas Waeber's avatar Jonas Waeber

Fix date facet decades for round years.

parent c020242d
Pipeline #17590 passed with stages
in 7 minutes and 40 seconds
......@@ -145,7 +145,10 @@ object DateFacetBuildHelpers {
private fun getDecade(year: Int): String {
val reminder = year % 10
val startYear = year - reminder
val startYear = if (reminder == 0)
year - 10
else
year - reminder
return "${startYear + 1}-${startYear + 10}"
}
}
......@@ -143,6 +143,13 @@ class TestFacetBuilders {
}
private fun testDates() = Stream.of(
TestDate(
"1920-09-14",
"single",
listOf(
"0~20.Jahrhundert~", "1~20.Jahrhundert~1911-1920~"
)
),
TestDate(
"1921-09-14",
"single",
......@@ -168,6 +175,11 @@ class TestFacetBuilders {
"range",
listOf("0~20.Jahrhundert~", "1~20.Jahrhundert~1921-1930~")
),
TestDate(
"1920/1930",
"range",
listOf("0~20.Jahrhundert~", "1~20.Jahrhundert~1911-1920~", "1~20.Jahrhundert~1921-1930~")
),
TestDate(
"1921/1931",
"range",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment