Fix date parsing
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 1 Jun 2016 05:10:25 +0000 (07:10 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 1 Jun 2016 05:10:25 +0000 (07:10 +0200)
src/main/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilter.kt
src/test/kotlin/net/pterodactylus/rhynodge/webpages/weather/wetterde/WetterDeFilterTest.kt
src/test/resources/net/pterodactylus/rhynodge/webpages/weather/wetterde/wetter.de.html

index fc3f500..9df926f 100644 (file)
@@ -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 {
index fa79869..f251cf8 100644 (file)
@@ -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
index 8fb8021..63452e3 100644 (file)
@@ -1518,7 +1518,7 @@ document.write('<img class="pixel" id="uimpixel" src="//uidbox.uimserv.net/cgi-b
     </div>
 
     <div class="forecast-detail-headline">
-        <div class="wt-h2">Montag, den 30. Mai 2016</div>
+        <div class="wt-h2">Mittwoch, den 01. Juni 2016</div>
     </div>