// For the ending date, we want the end of the selected day which is
 public Date getEndDate() {
   gc.set(Calendar.DAY_OF_MONTH, (date + 1));
   gc.set(Calendar.AM_PM, Calendar.AM);
   gc.set(Calendar.HOUR, 23);
   gc.set(Calendar.MINUTE, 59);
   gc.set(Calendar.SECOND, 59);
   return (gc.getTime());
 }
Beispiel #2
0
 /**
  * Set calendar to this week's Monday; set year and week combo boxes to the currently set date;
  * set the date labels appropriately; and, refresh the review table.
  */
 private void updateYearWeekDates() {
   yearWeekCalendar.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
   yearWeekCalendar.set(Calendar.HOUR_OF_DAY, 0);
   yearWeekCalendar.set(Calendar.MINUTE, 0);
   yearWeekCalendar.set(Calendar.SECOND, 0);
   yearWeekCalendar.set(Calendar.MILLISECOND, 0);
   yearCB.setSelectedItem(yearWeekCalendar.get(Calendar.YEAR));
   weekCB.setSelectedItem(yearWeekCalendar.get(Calendar.WEEK_OF_YEAR));
   fromDate.setDate(yearWeekCalendar);
   yearWeekCalendar.add(Calendar.DAY_OF_MONTH, 7);
   toDate.setDate(yearWeekCalendar);
   yearWeekCalendar.add(Calendar.DAY_OF_MONTH, -7);
   refreshReviewTable();
 }
 private static GregorianCalendar parseDate(final String dateString) {
   GregorianCalendar calendar = new GregorianCalendar(TimeZone.getTimeZone("UTC"));
   try {
     calendar.set(Calendar.YEAR, Integer.parseInt(dateString.substring(0, 4)));
     calendar.set(Calendar.MONTH, Integer.parseInt(dateString.substring(4, 6)) - 1);
     calendar.set(Calendar.DAY_OF_MONTH, Integer.parseInt(dateString.substring(6, 8)));
     if (dateString.length() > 8) {
       calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(dateString.substring(8, 10)));
       calendar.set(Calendar.MINUTE, Integer.parseInt(dateString.substring(10, 12)));
     } else {
       calendar.set(Calendar.HOUR_OF_DAY, 0);
       calendar.set(Calendar.MINUTE, 0);
     }
   } catch (Exception ignore) {
   }
   return calendar;
 }