public static DvDate getDvDate(Calendar cal) { return new DvDate( cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DAY_OF_MONTH)); }
/** * Parses a string value and return a DvDate */ public DvDate parse(String value) { DateTime date = DvDateTimeParser.parseDate(value); return new DvDate(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth()); }
/** * Parses a string value and return a DvDate */ public DvDate parse(String value) { DateTime date = DvDateTimeParser.parseDate(value); return new DvDate(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth()); }
final public DvDate date_value() throws ParseException { Token t; t = jj_consume_token(V_DATE); try { {if (true) return new DvDate(t.image);} } catch(Exception ignored) { {if (true) throw new ParseException("wrong date format: " + t.image);} } throw new Error("Missing return statement in function"); }
final public DvDate date_value() throws ParseException { Token t; t = jj_consume_token(V_DATE); try { {if (true) return new DvDate(t.image);} } catch(Exception ignored) { {if (true) throw new ParseException("wrong date format: " + t.image);} } throw new Error("Missing return statement in function"); }
final public DvDate date_value() throws ParseException { Token t; t = jj_consume_token(V_DATE); try { {if (true) return new DvDate(t.image);} } catch (Exception ignored) { {if (true) throw new ParseException("wrong date format: " + t.image);} } throw new Error("Missing return statement in function"); }
final public DvDate date_value() throws ParseException { Token t; t = jj_consume_token(V_DATE); try { {if (true) return new DvDate(t.image);} } catch (Exception ignored) { {if (true) throw new ParseException("wrong date format: " + t.image);} } throw new Error("Missing return statement in function"); }
private static DvDate create(DvDate dvDate, String attributeName, Object value) throws InternalErrorException { Calendar cal = Calendar.getInstance(); setCalendar(cal, Calendar.YEAR, attributeName, (Integer) value, "year", dvDate.getYear()); setCalendar(cal, Calendar.MONTH, attributeName, ((Integer) value) - 1, "month", dvDate.getMonth() - 1); //We need to subtract one because calendar month starts at 0 setCalendar(cal, Calendar.DATE, attributeName, (Integer) value, "day", dvDate.getDay()); return new DvDate( cal.get(Calendar.YEAR), cal.get(Calendar.MONTH) + 1, cal.get(Calendar.DATE)); }
@Override public DvDate add(DvDuration q) { if (!getDiffType().isInstance(q)) { throw new IllegalArgumentException("invalid difference type"); } DvDuration d = (DvDuration) q; MutableDateTime mdate = getDateTime().toMutableDateTimeISO(); mdate.add(d.getPeriod()); return new DvDate(getOtherReferenceRanges(), getNormalRange(), getNormalStatus(), getAccuracy(), getMagnitudeStatus(), mdate.toDateTimeISO(), toString()); }
@Override public DvDate add(DvDuration q) { if (!getDiffType().isInstance(q)) { throw new IllegalArgumentException("invalid difference type"); } DvDuration d = (DvDuration) q; MutableDateTime mdate = getDateTime().toMutableDateTimeISO(); mdate.add(d.getPeriod()); return new DvDate(getOtherReferenceRanges(), getNormalRange(), getNormalStatus(), getAccuracy(), getMagnitudeStatus(), mdate.toDateTimeISO(), toString()); }