Index: lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java
===================================================================
diff -u -r2f725f8ef2aa09a2663b2335bf67213074426d11 -r40f884f2618cf022c3cb27aaa6e7e5cc04a96ae1
--- lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 2f725f8ef2aa09a2663b2335bf67213074426d11)
+++ lams_tool_laqa/src/java/org/lamsfoundation/lams/tool/qa/web/QaLearningAction.java (.../QaLearningAction.java) (revision 40f884f2618cf022c3cb27aaa6e7e5cc04a96ae1)
@@ -1097,8 +1097,10 @@
}
DateFormat dateFormatter = new SimpleDateFormat(DateUtil.PRETTY_FORMAT);
+ dateFormatter.setTimeZone(userTimeZone);
// setting date format to ISO8601 for jquery.timeago
DateFormat dateFormatterTimeAgo = new SimpleDateFormat(DateUtil.ISO8601_FORMAT);
+ dateFormatterTimeAgo.setTimeZone(TimeZone.getTimeZone("GMT"));
for (QaUsrResp response : responses) {
QaQueUsr user = response.getQaQueUser();
@@ -1114,11 +1116,12 @@
responseRow.put("userName", StringEscapeUtils.escapeCsv(user.getFullname()));
responseRow.put("visible", new Boolean(response.isVisible()).toString());
- // format attemptTime
+ // format attemptTime - got straight from server time to other timezones in formatter
+ // as trying to convert dates runs into tz issues - any Date object created is still
+ // in the server time zone.
Date attemptTime = response.getAttemptTime();
- attemptTime = DateUtil.convertToTimeZoneFromDefault(userTimeZone, attemptTime);
responseRow.put("attemptTime", dateFormatter.format(attemptTime));
- responseRow.put("timeAgo", dateFormatterTimeAgo.format(attemptTime));
+ responseRow.put("timeAgo", dateFormatterTimeAgo.format(attemptTime));
if (isAllowRateAnswers) {
Index: lams_tool_sbmt/web/WEB-INF/tags/Date.tag
===================================================================
diff -u -rb6718851271ad991d43a5a3158f8e10c9ccceaaa -r40f884f2618cf022c3cb27aaa6e7e5cc04a96ae1
--- lams_tool_sbmt/web/WEB-INF/tags/Date.tag (.../Date.tag) (revision b6718851271ad991d43a5a3158f8e10c9ccceaaa)
+++ lams_tool_sbmt/web/WEB-INF/tags/Date.tag (.../Date.tag) (revision 40f884f2618cf022c3cb27aaa6e7e5cc04a96ae1)
@@ -34,6 +34,7 @@
<%@ attribute name="value" required="true" rtexprvalue="true" type="java.util.Date" %>
<%@ attribute name="style" required="false" rtexprvalue="true"%>
<%@ attribute name="type" required="false" rtexprvalue="true"%>
+<%@ attribute name="timeago" required="false" rtexprvalue="true"%>
<%@ taglib uri="tags-fmt" prefix="fmt" %>
<%@ taglib uri="tags-core" prefix="c" %>
@@ -42,6 +43,10 @@