/** * Given this date, return the best Starting date and time. If none, * just return the date that was passed in. */ public Date getStartDate(Date date) { Date dateEtd = ((TimeField)this.getField(Product.ETD)).getDateTime(); if (dateEtd == null) return date; Calendar calendar = Converter.gCalendar; calendar.setTime(dateEtd); int iHour = calendar.get(Calendar.HOUR_OF_DAY); int iMinute = calendar.get(Calendar.MINUTE); int iSecond = calendar.get(Calendar.SECOND); int iMillisecond = calendar.get(Calendar.MILLISECOND); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, iHour); calendar.set(Calendar.MINUTE, iMinute); calendar.set(Calendar.SECOND, iSecond); calendar.set(Calendar.MILLISECOND, iMillisecond); date = calendar.getTime(); return date; } /**
/** * Given this date, return the best Starting date and time. If none, * just return the date that was passed in. */ public Date getStartDate(Date date) { Date dateEtd = ((TimeField)this.getField(Product.ETD)).getDateTime(); if (dateEtd == null) return date; Calendar calendar = Converter.gCalendar; calendar.setTime(dateEtd); int iHour = calendar.get(Calendar.HOUR_OF_DAY); int iMinute = calendar.get(Calendar.MINUTE); int iSecond = calendar.get(Calendar.SECOND); int iMillisecond = calendar.get(Calendar.MILLISECOND); calendar.setTime(date); calendar.set(Calendar.HOUR_OF_DAY, iHour); calendar.set(Calendar.MINUTE, iMinute); calendar.set(Calendar.SECOND, iSecond); calendar.set(Calendar.MILLISECOND, iMillisecond); date = calendar.getTime(); return date; } /**
if (!recHotel.getField(Hotel.CHECK_OUT).isNull()) calendar.setTime(((TimeField)recHotel.getField(Hotel.CHECK_OUT)).getDateTime()); iHour = calendar.get(Calendar.HOUR_OF_DAY); iMinute = calendar.get(Calendar.MINUTE);
if (!recHotel.getField(Hotel.CHECK_OUT).isNull()) calendar.setTime(((TimeField)recHotel.getField(Hotel.CHECK_OUT)).getDateTime()); iHour = calendar.get(Calendar.HOUR_OF_DAY); iMinute = calendar.get(Calendar.MINUTE);
if ((recProduct != null) && (!recProduct.getField(Product.ETD).isNull())) timeDetail = ((TimeField)recProduct.getField(Product.ETD)).getDateTime(); bSetTime = true; // Did supply a time
if ((recProduct != null) && (!recProduct.getField(Product.ETD).isNull())) timeDetail = ((TimeField)recProduct.getField(Product.ETD)).getDateTime(); bSetTime = true; // Did supply a time