aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-13 17:52:28 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-13 17:52:28 +0500
commit2309d53f52f25efe00f2195a58c448506a2605ab (patch)
tree9fdddd2384e4e331c1642f919d3db4fb1621cccb /src/org/traccar/notification
parent633bed5cd14c16d53c7b84ed2c6586915467e1a8 (diff)
downloadtraccar-server-2309d53f52f25efe00f2195a58c448506a2605ab.tar.gz
traccar-server-2309d53f52f25efe00f2195a58c448506a2605ab.tar.bz2
traccar-server-2309d53f52f25efe00f2195a58c448506a2605ab.zip
- Add timezone field to User and Server model
- Pass Velocity DateTool to templates - Adjusted templates to use timezone
Diffstat (limited to 'src/org/traccar/notification')
-rw-r--r--src/org/traccar/notification/NotificationFormatter.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/org/traccar/notification/NotificationFormatter.java b/src/org/traccar/notification/NotificationFormatter.java
index cec238548..eae2681c9 100644
--- a/src/org/traccar/notification/NotificationFormatter.java
+++ b/src/org/traccar/notification/NotificationFormatter.java
@@ -18,10 +18,12 @@ package org.traccar.notification;
import java.io.StringWriter;
import java.nio.charset.StandardCharsets;
+import java.util.Locale;
import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.exception.ResourceNotFoundException;
+import org.apache.velocity.tools.generic.DateTool;
import org.traccar.Context;
import org.traccar.helper.Log;
import org.traccar.model.Device;
@@ -48,6 +50,9 @@ public final class NotificationFormatter {
velocityContext.put("geofence", Context.getGeofenceManager().getGeofence(event.getGeofenceId()));
}
velocityContext.put("webUrl", Context.getVelocityEngine().getProperty("web.url"));
+ velocityContext.put("dateTool", new DateTool());
+ velocityContext.put("timezone", ReportUtils.getTimezone(userId));
+ velocityContext.put("locale", Locale.getDefault());
return velocityContext;
}