From f157f4060e988f96711c20084d98db6885850622 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 1 Jun 2016 07:10:25 +0200 Subject: [PATCH] Fix date parsing --- .../pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt | 2 +- .../rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt | 2 +- .../net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt b/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt index fc3f500..9df926f 100644 --- a/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt +++ b/src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt @@ -26,7 +26,7 @@ import java.util.Locale class WetterDeFilter : Filter { object DateParser { - val parser = DateTimeFormatter.ofPattern("dd. MMM yyyy").withLocale(Locale.GERMAN).withZone(ZoneId.of("Europe/Berlin")) + val parser = DateTimeFormatter.ofPattern("dd. MMMM yyyy").withLocale(Locale.GERMAN).withZone(ZoneId.of("Europe/Berlin")) } override fun filter(state: State): State { diff --git a/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt b/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt index fa79869..f251cf8 100644 --- a/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt +++ b/src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt @@ -45,7 +45,7 @@ class WetterDeFilterTest { fun filterCanParseDateCorrectly() { val htmlState = HtmlState(url, ResourceLoader.loadDocument(javaClass, "wetter.de.html", url)) val wetterDeState = filter.filter(htmlState) as WeatherState - assertThat(wetterDeState.dateTime, `is`(ZonedDateTime.of(2016, 5, 30, 0, 0, 0, 0, ZoneId.of("Europe/Berlin")))) + assertThat(wetterDeState.dateTime, `is`(ZonedDateTime.of(2016, 6, 1, 0, 0, 0, 0, ZoneId.of("Europe/Berlin")))) } @Test diff --git a/src/test/resources/net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html b/src/test/resources/net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html index 8fb8021..63452e3 100644 --- a/src/test/resources/net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html +++ b/src/test/resources/net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html @@ -1518,7 +1518,7 @@ document.write(' -
Montag, den 30. Mai 2016
+
Mittwoch, den 01. Juni 2016
-- 2.7.4