aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-03-14 22:24:17 +1300
committerGitHub <noreply@github.com>2017-03-14 22:24:17 +1300
commite85f2a54420aa1299ea70b0bcf4a0c870620a31a (patch)
tree6a0ce5ded2fd24e5cf98f5e5f04095a03593105d /src/org/traccar/model
parentb3e2f211c3a3c64c8fa704ba1942970bb97f8eae (diff)
parent1b499620810fe6d376a4a72c5ab66b6be2f4af5c (diff)
downloadtraccar-server-e85f2a54420aa1299ea70b0bcf4a0c870620a31a.tar.gz
traccar-server-e85f2a54420aa1299ea70b0bcf4a0c870620a31a.tar.bz2
traccar-server-e85f2a54420aa1299ea70b0bcf4a0c870620a31a.zip
Merge pull request #3001 from Abyss777/timezone
Timezone field to User and Server model
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/Server.java11
-rw-r--r--src/org/traccar/model/User.java10
2 files changed, 21 insertions, 0 deletions
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index b588a4de0..4ded65204 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -15,6 +15,8 @@
*/
package org.traccar.model;
+import java.util.TimeZone;
+
import org.traccar.helper.Log;
public class Server extends Extensible {
@@ -166,4 +168,13 @@ public class Server extends Extensible {
this.coordinateFormat = coordinateFormat;
}
+ private String timezone;
+
+ public void setTimezone(String timezone) {
+ this.timezone = timezone != null ? TimeZone.getTimeZone(timezone).getID() : null;
+ }
+
+ public String getTimezone() {
+ return timezone;
+ }
}
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index 274f2b2a2..366ced503 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,13 @@ public class User extends Extensible {
return Hashing.validatePassword(password, hashedPassword, salt);
}
+ private String timezone;
+
+ public void setTimezone(String timezone) {
+ this.timezone = timezone != null ? TimeZone.getTimeZone(timezone).getID() : null;
+ }
+
+ public String getTimezone() {
+ return timezone;
+ }
}