/** * Returns the selected date, or null if none is selected. * * @return the selected date, or null */ public final Date getValue() { return CalendarUtil.copyDate(value); }
/** * Gets the highlighted date (the one the mouse is hovering over), if any. * * @return the highlighted date */ public final Date getHighlightedDate() { return CalendarUtil.copyDate(highlighted); }
/** * Creates a new date value change event. * * @param value the value */ protected DateChangeEvent(Date value) { // The date must be copied in case one handler causes it to change. super(CalendarUtil.copyDate(value)); }
@Override public Date getValue() { return CalendarUtil.copyDate(super.getValue()); } }
@Override public Date getHighlighted() { return CalendarUtil.copyDate(super.getHighlighted()); } }
/** * Returns the number of days between the two dates. Time is ignored. * * @param start starting date * @param finish ending date * @return the different */ public static int getDaysBetween(Date start, Date finish) { // Convert the dates to the same time start = copyDate(start); resetTime(start); finish = copyDate(finish); resetTime(finish); long aTime = start.getTime(); long bTime = finish.getTime(); long adjust = 60 * 60 * 1000; adjust = (bTime > aTime) ? adjust : -adjust; return (int) ((bTime - aTime + adjust) / (24 * 60 * 60 * 1000)); }
/** * Gets the highlighted date (the one the mouse is hovering over), if any. * * @return the highlighted date */ public final Date getHighlightedDate() { return CalendarUtil.copyDate(highlighted); }
/** * Returns the selected date, or null if none is selected. * * @return the selected date, or null */ public final Date getValue() { return CalendarUtil.copyDate(value); }
/** * Gets the highlighted date (the one the mouse is hovering over), if any. * * @return the highlighted date */ public final Date getHighlightedDate() { return CalendarUtil.copyDate(highlighted); }
/** * Creates a new date value change event. * * @param value the value */ protected DateChangeEvent(Date value) { // The date must be copied in case one handler causes it to change. super(CalendarUtil.copyDate(value)); }
/** * Creates a new date value change event. * * @param value the value */ protected DateChangeEvent(Date value) { // The date must be copied in case one handler causes it to change. super(CalendarUtil.copyDate(value)); }
/** * Returns the selected date, or null if none is selected. * * @return the selected date, or null */ public final Date getValue() { return CalendarUtil.copyDate(value); }
/** * Sets the {@link DatePicker}'s value. * * @param newValue the new value for this date picker * @param fireEvents should events be fired. */ public final void setValue(Date newValue, boolean fireEvents) { Date oldValue = value; if (oldValue != null) { removeStyleFromDates(css().dayIsValue(), oldValue); } value = CalendarUtil.copyDate(newValue); if (value != null) { addStyleToDates(css().dayIsValue(), value); } getView().setAriaSelectedCell(newValue); if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue); } }
@Override public Date getHighlighted() { return CalendarUtil.copyDate(super.getHighlighted()); } }
@Override public Date getValue() { return CalendarUtil.copyDate(super.getValue()); } }
@Override public Date getValue() { return CalendarUtil.copyDate(super.getValue()); } }
@Override public Date getHighlighted() { return CalendarUtil.copyDate(super.getHighlighted()); } }
/** * Returns the number of days between the two dates. Time is ignored. * * @param start starting date * @param finish ending date * @return the different */ public static int getDaysBetween(Date start, Date finish) { // Convert the dates to the same time start = copyDate(start); resetTime(start); finish = copyDate(finish); resetTime(finish); long aTime = start.getTime(); long bTime = finish.getTime(); long adjust = 60 * 60 * 1000; adjust = (bTime > aTime) ? adjust : -adjust; return (int) ((bTime - aTime + adjust) / (24 * 60 * 60 * 1000)); }
/*************************************** * Returns the currently displayed time with the calendar date of the date * parameter. * * @param rDate The calendar date to apply the time to * * @return A new date object with the combined date and time */ @SuppressWarnings("deprecation") public Date applyTime(Date rDate) { if (rDate != null) { rDate = CalendarUtil.copyDate(rDate); rDate.setHours(aHoursField.getValue()); rDate.setMinutes(aMinutesField.getValue()); } return rDate; }
/** * Sets the {@link DatePicker}'s value. * * @param newValue the new value for this date picker * @param fireEvents should events be fired. */ public final void setValue(Date newValue, boolean fireEvents) { Date oldValue = value; if (oldValue != null) { removeStyleFromDates(css().dayIsValue(), oldValue); } value = CalendarUtil.copyDate(newValue); if (value != null) { addStyleToDates(css().dayIsValue(), value); } getView().setAriaSelectedCell(newValue); if (fireEvents) { DateChangeEvent.fireIfNotEqualDates(this, oldValue, newValue); } }