summaryrefslogtreecommitdiff
path: root/src/main/groovy/org/xapek/yvesf
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/groovy/org/xapek/yvesf')
-rw-r--r--src/main/groovy/org/xapek/yvesf/classifieds/Model.groovy6
1 files changed, 5 insertions, 1 deletions
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"