From 57a3a39ba2b79c37f59d212bb14c7f9df91cf478 Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 26 Jan 2016 12:00:49 +0100 Subject: more fix rss feed --- src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy index b0c9e00..ac5ca13 100644 --- a/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy +++ b/src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy @@ -2,6 +2,8 @@ package org.xapek.yvesf.classifieds import groovy.transform.CompileStatic +import java.text.SimpleDateFormat + @CompileStatic class Model { static class Classified { @@ -62,8 +64,10 @@ class Model { } } + final static SimpleDateFormat dateParser = new SimpleDateFormat('MMM dd, yy', Locale.GERMANY) + final static SimpleDateFormat dateFormatter = new SimpleDateFormat('EEE, dd MMM yyyy HH:mm:ss Z', Locale.ROOT) String getFormattedDate() { - return Date.parse('MMM dd, yy', date).format('EEE, dd MMM yyyy HH:mm:ss Z') + return dateFormatter.format(dateParser.parse(date)) } String getLink() { return "http://www.glocals.com/classifieds/housing-and-real-estate/${id}.htm" -- cgit v1.2.1