Return the sortable date in the form of a Calendar.

@return the calendar
432520
private Calendar getSortCalendar() {
        if (sortDate == null) {
            final DateParser parser = new DateParser(getDate());
            sortDate = parser.getSortCalendar();
        }
        return sortDate;
    }
1108936
public static Date getRoundedDayCurDate() {
        Calendar cal = new GregorianCalendar();

        return new GregorianCalendar(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DAY_OF_MONTH))
                   .getTime();
    }
21589
public List<GoogleCalendar> getGoogleCalendars() {
        List<GoogleCalendar> googleCalendars = new ArrayList<>();
        for (Calendar calendar : getCalendars()) {
            if (!(calendar instanceof GoogleCalendar)) {
                continue;
            }
            googleCalendars.add((GoogleCalendar) calendar);
        }
        return googleCalendars;
    }
982673
private static Calendar buildCalendar() {

    Calendar calendar = calendarCache.get();
    if (calendar == null) {
      calendar = GregorianCalendar.getInstance();
      calendarCache.set(calendar);
    }
    return calendar;
  }
1288542
public String getDate() {
        SimpleDateFormat formatter = new SimpleDateFormat("MM/dd/yyyy");
        String date = formatter.format(calendar.getTime());

        return date;
    }
896810
public Calendar getLastUpdateTime() {
        if (null != lastUpdateTime && lastUpdateTime.after(Calendar.getInstance())) {
            LOG.warn("Last update time newer than now {} for {}", lastUpdateTime, owner);
            return null; // Something's broken - we don't know
        }
        return lastUpdateTime;
    }
729736
public Calendar getEnd() {
		Calendar cal = Calendar.getInstance();
		cal.setTimeInMillis(end);
		return cal;
	}
790449
private Calendar getAccessWindowEnd() {

        // Get window end time
        Time end = getModel().getAccessWindowEnd();
        if (end == null)
            return null;

        // Return within defined time zone, current day
        return asCalendar(Calendar.getInstance(getTimeZone()), end);

    }
441324
private static synchronized Calendar buildCalendar() {

    if (calendarCache.isEmpty()) {
      return GregorianCalendar.getInstance();
    } else {
      Calendar calendar = calendarCache.firstElement();
      calendarCache.remove(0);
      return calendar;
    }
  }
1121443
public ProjectCalendar getCalendar()
   {
      ProjectCalendar calendar = null;
      Resource resource = getResource();
      if (resource != null)
      {
         calendar = resource.getResourceCalendar();
      }

      Task task = getTask();
      if (calendar == null || task.getIgnoreResourceCalendar())
      {
         calendar = task.getEffectiveCalendar();
      }

      return calendar;
   }
173468
public Date getDate() {
        for (int i = 0; i < info.length() - 9; i++) {
            if (Character.isWhitespace(info.charAt(i))) {
                String dateString = info.substring(i + 1, i + 9);
                try {
                    synchronized (formatter) {
                        return formatter.parse(dateString);
                    }
                } catch (ParseException pe) {
                }
                break;
            }
        }
        return null;
    }
665930
public static Calendar getCal(final Date date) {
        if (date == null) {
            return null;
        }
        final Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return blastTime(cal);
    }
1000733
public static Calendar createCalendar(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);
        return cal;
    }
1021777
public static CharSequence getJSDate(Calendar calendar)
	{
		StringBuilder dateJavascript = new StringBuilder();
		dateJavascript.append("new Date(");
		dateJavascript.append(calendar.get(Calendar.YEAR)).append(',');
		dateJavascript.append(calendar.get(Calendar.MONTH)).append(',');
		dateJavascript.append(calendar.get(Calendar.DAY_OF_MONTH)).append(',');
		dateJavascript.append(calendar.get(Calendar.HOUR_OF_DAY)).append(',');
		dateJavascript.append(calendar.get(Calendar.MINUTE)).append(',');
		dateJavascript.append(calendar.get(Calendar.SECOND)).append(',');
		dateJavascript.append(calendar.get(Calendar.MILLISECOND));
		dateJavascript.append(')');

		return dateJavascript.toString();
	}
1304856
public Date getEndDate() {
        DateRange range = getSelectedRange();
        return range == null ? null : range.getEndDate();
    }
419735
public Calendar getSelectedDate() {
        Calendar result = dateSpinner.getSelectedDate();
        Calendar time = timeSpinner.getSelectedTime();
        if(result!=null && time!=null) {
            result.set(Calendar.HOUR_OF_DAY, time.get(Calendar.HOUR_OF_DAY));
            result.set(Calendar.MINUTE, time.get(Calendar.MINUTE));
            return result;
        }
        else return null;
    }
346408
public Calendar getCalendar() {
        if (calendar == null) {
            return guessCalendar();
        }
        Calendar temp = (Calendar) calendar.clone(); // clone for safety
        temp.setTimeZone(getTimeZone());
        temp.setTimeInMillis(System.currentTimeMillis());
        return temp;
    }