Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Add MomentJS formats for Timestamp value types ( Fix for #1023) (#1598)

Panos Kalogeropoulos6f7d08b6e327
diff --git a/model/src/main/java/org/openremote/model/value/ValueType.java b/model/src/main/java/org/openremote/model/value/ValueType.java
index 31ed08cb8..7045d6176 100644
--- a/model/src/main/java/org/openremote/model/value/ValueType.java
+++ b/model/src/main/java/org/openremote/model/value/ValueType.java
@@ -108,11 +108,11 @@ public final class ValueType {
public static final ValueDescriptor<Long> TIMESTAMP = new ValueDescriptor<>("timestamp", Long.class,
new ValueConstraint.Min(0)
- );
+ ).withFormat(new ValueFormat().setAsDate(true).setMomentJsFormat("DD-MMM-YYYY hh:mm A"));
public static final ValueDescriptor<String> TIMESTAMP_ISO8601 = new ValueDescriptor<>("timestampISO8601", String.class,
new ValueConstraint.Pattern(Constants.ISO8601_DATETIME_REGEXP)
- );
+ ).withFormat(new ValueFormat().setAsDate(true).setMomentJsFormat("DD-MMM-YYYY hh:mm A"));
public static final ValueDescriptor<Date> DATE_AND_TIME = new ValueDescriptor<>("dateAndTime", Date.class);