diff options
Diffstat (limited to 'src/org/uic/barcode/ticket/api/asn')
6 files changed, 34 insertions, 26 deletions
diff --git a/src/org/uic/barcode/ticket/api/asn/omv1/CustomerCardData.java b/src/org/uic/barcode/ticket/api/asn/omv1/CustomerCardData.java index d0c5710..d67f857 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv1/CustomerCardData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv1/CustomerCardData.java @@ -21,7 +21,6 @@ package org.uic.barcode.ticket.api.asn.omv1; import java.util.Calendar;
import java.util.Date;
-import java.util.TimeZone;
import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -252,7 +251,6 @@ public class CustomerCardData extends Object { untilCal.setTime(untilDate);
int untildays = untilCal.get(Calendar.DAY_OF_YEAR);
-
int yearDiff = untilCal.get(Calendar.YEAR) - fromCal.get(Calendar.YEAR);
this.validUntilYear = new Long( yearDiff);
@@ -262,14 +260,15 @@ public class CustomerCardData extends Object { public Date getValidFromDate (){
- if (this.validFromYear == null || this.validFromYear == 0) return null;
+ if (this.validFromYear == null || this.validFromDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
-
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
}
@@ -277,17 +276,18 @@ public class CustomerCardData extends Object { public Date getValidUntilDate (){
- if (this.validUntilYear == null || this.validUntilYear == 0) return null;
+ if (this.validUntilYear == null || this.validUntilDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
if (this.validUntilYear != null) {
cal.add(Calendar.YEAR, this.validUntilYear.intValue());
}
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
-
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java b/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java index 8119502..8142ee1 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv1/ParkingGroundData.java @@ -47,7 +47,7 @@ public class ParkingGroundData extends Object { @FieldOrder(order = 2)
@RestrictedString(CharacterRestriction.IA5String)
- public String parkingGroundId;
+ public String parkingGroundId = "";
@FieldOrder(order = 3)
@IntRange(minValue=0,maxValue=370)
@@ -335,7 +335,7 @@ public class ParkingGroundData extends Object { public Date getFromParkingDate(Date issuingDate){
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, 0L);
}
@@ -343,7 +343,7 @@ public class ParkingGroundData extends Object { if ( this.toParkingDate == null) return null;
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, 1439L);
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java b/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java index f721201..ab9eaea 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv1/VoucherData.java @@ -21,7 +21,6 @@ package org.uic.barcode.ticket.api.asn.omv1; import java.util.Calendar;
import java.util.Date;
-import java.util.TimeZone;
import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -287,9 +286,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
@@ -301,9 +302,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validUntilYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java b/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java index 4302f44..6ea31c1 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/CustomerCardData.java @@ -262,14 +262,15 @@ public class CustomerCardData extends Object { public Date getValidFromDate (){
- if (this.validFromYear == null || this.validFromYear == 0) return null;
+ if (this.validFromYear == null || this.validFromDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
-
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
}
@@ -277,17 +278,18 @@ public class CustomerCardData extends Object { public Date getValidUntilDate (){
- if (this.validUntilYear == null || this.validUntilYear == 0) return null;
+ if (this.validUntilYear == null || this.validUntilDay == null) return null;
Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
if (this.validUntilYear != null) {
cal.add(Calendar.YEAR, this.validUntilYear.intValue());
}
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
-
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java b/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java index 4f6f6d8..0eec185 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/ParkingGroundData.java @@ -47,7 +47,7 @@ public class ParkingGroundData extends Object { @FieldOrder(order = 2)
@RestrictedString(CharacterRestriction.IA5String)
- public String parkingGroundId;
+ public String parkingGroundId = "";
@FieldOrder(order = 3)
@IntRange(minValue=0,maxValue=370)
@@ -335,7 +335,7 @@ public class ParkingGroundData extends Object { public Date getFromParkingDate(Date issuingDate){
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate, 0L);
}
@@ -343,7 +343,7 @@ public class ParkingGroundData extends Object { if ( this.toParkingDate == null) return null;
- return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, null);
+ return DateTimeUtils.getDate(issuingDate, this.fromParkingDate + this.toParkingDate, 1439L);
}
diff --git a/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java b/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java index 458b040..1395976 100644 --- a/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java +++ b/src/org/uic/barcode/ticket/api/asn/omv2/VoucherData.java @@ -21,7 +21,6 @@ package org.uic.barcode.ticket.api.asn.omv2; import java.util.Calendar;
import java.util.Date;
-import java.util.TimeZone;
import org.uic.barcode.asn1.datatypes.Asn1BigInteger;
import org.uic.barcode.asn1.datatypes.Asn1Optional;
@@ -287,9 +286,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validFromYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validFromDay.intValue());
+ cal.set(Calendar.MINUTE,0);
+ cal.set(Calendar.HOUR_OF_DAY,0);
return cal.getTime();
@@ -301,9 +302,11 @@ public class VoucherData extends Object { Calendar cal = Calendar.getInstance();
cal.clear();
- cal.setTimeZone(TimeZone.getTimeZone("UTC"));
+ //cal.setTimeZone(TimeZone.getTimeZone("UTC"));
cal.set(Calendar.YEAR, this.validUntilYear.intValue());
cal.set(Calendar.DAY_OF_YEAR, this.validUntilDay.intValue());
+ cal.set(Calendar.MINUTE,59);
+ cal.set(Calendar.HOUR_OF_DAY,23);
return cal.getTime();
|