diff options
author | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2022-01-21 18:19:36 +0100 |
---|---|---|
committer | CGantert345 <57003061+CGantert345@users.noreply.github.com> | 2022-01-21 18:19:36 +0100 |
commit | 17f05b763d70f350bad482df9378c571c2ebddf6 (patch) | |
tree | b388db6cdf2906fab3dd5a1dc2f79fbfe3f903ea /src/main/java/org/uic/barcode/dynamicContent | |
parent | extended api for dynamic content (diff) | |
download | UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar.gz UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar.bz2 UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar.lz UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar.xz UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.tar.zst UIC-barcode-17f05b763d70f350bad482df9378c571c2ebddf6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/main/java/org/uic/barcode/dynamicContent/fdc1/TimeStamp.java | 7 | ||||
-rw-r--r-- | src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java | 12 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/main/java/org/uic/barcode/dynamicContent/fdc1/TimeStamp.java b/src/main/java/org/uic/barcode/dynamicContent/fdc1/TimeStamp.java index a1b9581..c2cd8fa 100644 --- a/src/main/java/org/uic/barcode/dynamicContent/fdc1/TimeStamp.java +++ b/src/main/java/org/uic/barcode/dynamicContent/fdc1/TimeStamp.java @@ -105,17 +105,18 @@ public class TimeStamp { int dayOfYear = now.getDayOfYear();
if (dayOfYear - day.intValue() > 250) {
- now = now.plusDays(1);
+ now = now.plusYears(1);
}
if (day.intValue() - dayOfYear > 250) {
- now = now.minusDays(1);
+ now = now.minusYears(1);
}
now = now.withDayOfYear(1);
now = now.withSecond(0);
now = now.withHour(0);
now = now.withMinute(0);
- now = now.withDayOfYear(dayOfYear);
+ now = now.withNano(0);
+ now = now.withDayOfYear(day.intValue());
now = now.plusSeconds(secondOfDay);
return Date.from(now.toInstant());
diff --git a/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java b/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java index 3ced173..9957ede 100644 --- a/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java +++ b/src/main/java/org/uic/barcode/dynamicContent/fdc1/UicDynamicContentDataFDC1.java @@ -11,7 +11,9 @@ import org.uic.barcode.asn1.datatypes.HasExtensionMarker; import org.uic.barcode.asn1.datatypes.RestrictedString;
import org.uic.barcode.asn1.datatypes.Sequence;
import org.uic.barcode.asn1.uper.UperEncoder;
-import org.uic.barcode.dynamicFrame.DataType;
+import org.uic.barcode.dynamicFrame.api.IData;
+import org.uic.barcode.dynamicFrame.api.SimpleData;
+import org.uic.barcode.dynamicFrame.v1.DataType;
/**
@@ -94,6 +96,14 @@ public class UicDynamicContentDataFDC1 { return "FDC1";
}
+ public IData getApiDataType() {
+ IData data = new SimpleData();
+ data.setFormat(getFormat());
+ data.setData(UperEncoder.encode(this));
+ return data;
+ }
+
+
public DataType getDataType() {
DataType data = new DataType();
data.setFormat(getFormat());
|