|
@@ -10,7 +10,7 @@ import java.util.GregorianCalendar;
|
|
|
public class ActTime implements Serializable {
|
|
public class ActTime implements Serializable {
|
|
|
|
|
|
|
|
private GregorianCalendar beginTime, endTime;
|
|
private GregorianCalendar beginTime, endTime;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public ActTime(int y1, int m1, int d1, int hh1, int mm1, int y2, int m2, int d2, int hh2, int mm2){
|
|
public ActTime(int y1, int m1, int d1, int hh1, int mm1, int y2, int m2, int d2, int hh2, int mm2){
|
|
|
beginTime = new GregorianCalendar();
|
|
beginTime = new GregorianCalendar();
|
|
|
endTime = new GregorianCalendar();
|
|
endTime = new GregorianCalendar();
|
|
@@ -19,9 +19,26 @@ public class ActTime implements Serializable {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public ActTime(String beginTime, String endTime){
|
|
public ActTime(String beginTime, String endTime){
|
|
|
|
|
+ this.beginTime = new GregorianCalendar();
|
|
|
|
|
+ String[] timeParts = beginTime.split("-");
|
|
|
|
|
+ int y1 = Integer.valueOf(timeParts[0]);
|
|
|
|
|
+ int m1 = Integer.valueOf(timeParts[1]);
|
|
|
|
|
+ int d1 = Integer.valueOf(timeParts[2]);
|
|
|
|
|
+ int hh1 = Integer.valueOf(timeParts[3]);
|
|
|
|
|
+ int mm1 = Integer.valueOf(timeParts[4]);
|
|
|
|
|
+
|
|
|
|
|
+ this.endTime = new GregorianCalendar();
|
|
|
|
|
+ String[] timeParts2 = endTime.split("-");
|
|
|
|
|
+ int y2 = Integer.valueOf(timeParts2[0]);
|
|
|
|
|
+ int m2 = Integer.valueOf(timeParts2[1]);
|
|
|
|
|
+ int d2 = Integer.valueOf(timeParts2[2]);
|
|
|
|
|
+ int hh2 = Integer.valueOf(timeParts2[3]);
|
|
|
|
|
+ int mm2 = Integer.valueOf(timeParts2[4]);
|
|
|
|
|
|
|
|
|
|
+ this.setBeginTime(y1, m1, d1, hh1, mm1);
|
|
|
|
|
+ this.setEndTime(y2, m2, d2, hh2, mm2);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
public void setBeginTime(int y, int m, int d, int hh, int mm){
|
|
public void setBeginTime(int y, int m, int d, int hh, int mm){
|
|
|
beginTime.set(y,m-1,d,hh,mm);
|
|
beginTime.set(y,m-1,d,hh,mm);
|
|
|
}
|
|
}
|
|
@@ -58,7 +75,6 @@ public class ActTime implements Serializable {
|
|
|
endTime.get(Calendar.HOUR_OF_DAY) + ":" +
|
|
endTime.get(Calendar.HOUR_OF_DAY) + ":" +
|
|
|
minutes;
|
|
minutes;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
public GregorianCalendar getBeginTime() {
|
|
public GregorianCalendar getBeginTime() {
|
|
|
return beginTime;
|
|
return beginTime;
|
|
|
}
|
|
}
|