@Test public void testMonth() throws Exception { Date now = new Date(); assertEquals(new StringToTime("October", now), new StringToTime("Oct", now)); Calendar cal = Calendar.getInstance(); cal.setTime(now); assertEquals(cal.get(Calendar.YEAR), new StringToTime("January", now).getCal().get(Calendar.YEAR)); assertEquals(cal.get(Calendar.YEAR), new StringToTime("December", now).getCal().get(Calendar.YEAR)); }
public Calendar getCal() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(super.getTime()); return cal; }
StringToTime extends Date { public Calendar getCal() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(super.getTime()); return cal; } }
StringToTime extends Date { public Calendar getCal() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(super.getTime()); return cal; } StringToTime();  StringToTime(Date date);  StringToTime(Object dateTimeString);  StringToTime(Object dateTimeString, String simpleDateFormat);  StringToTime(Object dateTimeString, Date now);  StringToTime(Object dateTimeString, Long now);  StringToTime(Object dateTimeString, Integer now);  StringToTime(Object dateTimeString, Date now, String simpleDateFormat); }
StringToTime extends Date { public Calendar getCal() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(super.getTime()); return cal; } StringToTime();  StringToTime(Date date);  StringToTime(Object dateTimeString);  StringToTime(Object dateTimeString, String simpleDateFormat);  StringToTime(Object dateTimeString, Date now);  StringToTime(Object dateTimeString, Long now);  StringToTime(Object dateTimeString, Integer now);  StringToTime(Object dateTimeString, Date now, String simpleDateFormat); @Override long getTime(); Calendar getCal(); String format(String simpleDateFormat); @Override String toString(); static Object time(Object dateTimeString); static Object time(Object dateTimeString, Date now); static Object date(Object dateTimeString); static Object date(Object dateTimeString, Date now); static Object cal(Object dateTimeString); static Object cal(Object dateTimeString, Date now); }
StringToTime extends Date { public Calendar getCal() { Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(super.getTime()); return cal; } StringToTime();  StringToTime(Date date);  StringToTime(Object dateTimeString);  StringToTime(Object dateTimeString, String simpleDateFormat);  StringToTime(Object dateTimeString, Date now);  StringToTime(Object dateTimeString, Long now);  StringToTime(Object dateTimeString, Integer now);  StringToTime(Object dateTimeString, Date now, String simpleDateFormat); @Override long getTime(); Calendar getCal(); String format(String simpleDateFormat); @Override String toString(); static Object time(Object dateTimeString); static Object time(Object dateTimeString, Date now); static Object date(Object dateTimeString); static Object date(Object dateTimeString, Date now); static Object cal(Object dateTimeString); static Object cal(Object dateTimeString, Date now);  }