code: public static Calendar dateStringToCalendar(String dateString) {
          Calendar calendar = Calendar.getInstance();
          SimpleDateFormat formatter = new SimpleDateFormat(XLinkConstants.DATEFORMAT);
          try {
              calendar.setTime(formatter.parse(dateString));
          } catch (Exception ex) {
              return null;
          }
          return calendar;
      }
docs: Returns a Calendarobject to a given dateString in the Format 'DATEFORMAT'.
  If the given String is of the wrong format, null is returned.
  @see XLinkUtils#DATEFORMAT