aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-14 09:11:11 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-14 09:11:11 +0500
commit632e6ad06c435ca8d044e5ae3209cde36cf42743 (patch)
tree959a7791c6c436f1a8452de9adf0b3d5e0d36dcf /src/org/traccar/model
parent2309d53f52f25efe00f2195a58c448506a2605ab (diff)
downloadtraccar-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.tar.gz
traccar-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.tar.bz2
traccar-server-632e6ad06c435ca8d044e5ae3209cde36cf42743.zip
- Use ternary operator
- Apply server.forceSettings to speed units, distance units and timezone - Use hyphens for date formatting
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/Server.java6
-rw-r--r--src/org/traccar/model/User.java6
2 files changed, 2 insertions, 10 deletions
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index db3f021a9..4ded65204 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -171,11 +171,7 @@ public class Server extends Extensible {
private String timezone;
public void setTimezone(String timezone) {
- if (timezone != null) {
- this.timezone = TimeZone.getTimeZone(timezone).getID();
- } else {
- this.timezone = null;
- }
+ this.timezone = timezone != null ? TimeZone.getTimeZone(timezone).getID() : null;
}
public String getTimezone() {
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index 71bb563a8..366ced503 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -269,11 +269,7 @@ public class User extends Extensible {
private String timezone;
public void setTimezone(String timezone) {
- if (timezone != null) {
- this.timezone = TimeZone.getTimeZone(timezone).getID();
- } else {
- this.timezone = null;
- }
+ this.timezone = timezone != null ? TimeZone.getTimeZone(timezone).getID() : null;
}
public String getTimezone() {