diff options
author | Alexander Alexeev | 2016-12-07 18:53:37 +0700 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-07 22:37:17 +0300 |
commit | bad2718b1b85d806221fce52c76fa1d388993396 (patch) | |
tree | 8788b2b128012c3688fe9d56f295039c8d86f7b3 /juick-www/src/main/java/com/juick | |
parent | 3f0229dd0c0d07286604c77980ca578c1b3b8cbc (diff) |
singleton java 8 date formatters
Diffstat (limited to 'juick-www/src/main/java/com/juick')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/RSS.java | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/juick-www/src/main/java/com/juick/www/RSS.java b/juick-www/src/main/java/com/juick/www/RSS.java index a343d13b..91ba9380 100644 --- a/juick-www/src/main/java/com/juick/www/RSS.java +++ b/juick-www/src/main/java/com/juick/www/RSS.java @@ -19,6 +19,7 @@ package com.juick.www; import com.juick.Message; import com.juick.server.MessagesQueries; +import com.juick.util.DateFormattersHolder; import com.juick.util.MessageUtils; import com.mitchellbosecke.pebble.error.PebbleException; import com.mitchellbosecke.pebble.template.PebbleTemplate; @@ -28,7 +29,6 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.PrintWriter; -import java.text.SimpleDateFormat; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -39,8 +39,6 @@ import java.util.Map; */ public class RSS { - private static final SimpleDateFormat sdfRSS = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); - protected void doGet(JdbcTemplate sql, HttpServletResponse response, int uid) throws ServletException, IOException, PebbleException { List<Integer> mids = MessagesQueries.getUserBlog(sql, uid, 0, 0); if (mids.isEmpty()) { @@ -58,7 +56,7 @@ public class RSS { Map<String, Object> context = new HashMap<>(); context.put("user", msgs.stream().findFirst().get().getUser()); context.put("msgs", msgs); - context.put("sdfRSS", sdfRSS); + context.put("sdfRSS", DateFormattersHolder.getRssFormatterInstance()); template.evaluate(out, context); } } |