diff options
author | Abyss777 <abyss@fox5.ru> | 2017-03-13 17:52:28 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-03-13 17:52:28 +0500 |
commit | 2309d53f52f25efe00f2195a58c448506a2605ab (patch) | |
tree | 9fdddd2384e4e331c1642f919d3db4fb1621cccb /src/org/traccar/model/User.java | |
parent | 633bed5cd14c16d53c7b84ed2c6586915467e1a8 (diff) | |
download | trackermap-server-2309d53f52f25efe00f2195a58c448506a2605ab.tar.gz trackermap-server-2309d53f52f25efe00f2195a58c448506a2605ab.tar.bz2 trackermap-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/model/User.java')
-rw-r--r-- | src/org/traccar/model/User.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java index 274f2b2a2..71bb563a8 100644 --- a/src/org/traccar/model/User.java +++ b/src/org/traccar/model/User.java @@ -19,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import org.traccar.helper.Hashing; import java.util.Date; +import java.util.TimeZone; public class User extends Extensible { @@ -265,4 +266,17 @@ public class User extends Extensible { return Hashing.validatePassword(password, hashedPassword, salt); } + private String timezone; + + public void setTimezone(String timezone) { + if (timezone != null) { + this.timezone = TimeZone.getTimeZone(timezone).getID(); + } else { + this.timezone = null; + } + } + + public String getTimezone() { + return timezone; + } } |