private DateTimePicker() { super(null, Locale.getDefault()); getMonthView().setSelectionModel(new SingleDaySelectionModel()); }
/** * Returns the week after <code>date</code>. * * @param date Date used in calculating next week * @return week after <code>date</code>. */ public static long nextWeek(long date) { return addDays(date, 7); }
/** * Returns true if the this <code>DateSpan</code> intersects with the * specified time. * * @param start Start time * @param end End time * @return true if this <code>DateSpan</code> intersects with the specified * time. */ public boolean intersects(long start, long end) { return (start <= getEnd() && end >= getStart()); }
/** * Returns the previous month. * * @param date Base date * @return previous month */ public static long getPreviousMonth(long date) { return incrementMonth(date, -1); }
/** * Returns the number of days difference between <code>t1</code> and * <code>t2</code>. * * @param t1 Time 1 * @param t2 Time 2 * @return Number of days between <code>start</code> and <code>end</code> */ public static int getDaysDiff(long t1, long t2) { return getDaysDiff(t1, t2, true); }
/** * Returns a sorted set of flagged Dates. The returned set is guaranteed to * be not null, but may be empty. * * @return a sorted set of flagged dates. */ public SortedSet<Date> getFlaggedDates() { return flaggedDates.getSelection(); }
/** * {@inheritDoc} */ @Override public void setSelectionMode(final SelectionMode selectionMode) { this.selectionMode = selectionMode; clearSelection(); }
/** * Returns the date corresponding to the end of the month. * * @param date Base date * @return End of month. */ public static long getEndOfMonth(long date) { return getMonth(date, 1); }
/** * Returns the start of the day of the given date in this model's calendar. * NOTE: the calendar is changed by this operation. * * @param date the Date to get the start for. * @return the Date representing the start of the day of the input date. */ protected Date startOfDay(Date date) { return CalendarUtils.startOfDay(calendar, date); }
/** * {@inheritDoc} <p> * * Implemented to call setSelectionInterval with startDate for both * parameters. */ @Override public void addSelectionInterval(Date startDate, Date endDate) { setSelection(startDate); }
/** * */ @Override public void setSelectionMode(final SelectionMode selectionMode) { this.selectionMode = selectionMode; clearSelection(); }
/** * Sets the time zone with the given time zone value. * * This is a bound property. * * @param tz The <code>TimeZone</code>. */ public void setTimeZone(TimeZone tz) { model.setTimeZone(tz); }
/** * Returns the week before <code>date</code>. * * @param date Date used in calculating previous week * @return week before <code>date</code>. */ public static long previousWeek(long date) { return addDays(date, -7); }
/** * Returns the next month. * * @param date Base date * @return next month */ public static long getNextMonth(long date) { return incrementMonth(date, 1); }
/** * Returns a sorted set of flagged Dates. The returned set is guaranteed to * be not null, but may be empty. * * @return a sorted set of flagged dates. */ public SortedSet<Date> getFlaggedDates() { return flaggedDates.getSelection(); }
/** * {@inheritDoc} */ @Override public void setSelectionMode(final SelectionMode selectionMode) { this.selectionMode = selectionMode; clearSelection(); }
/** * Returns the day before <code>date</code>. * * @param date Date used in calculating previous day * @return Day before <code>date</code>. */ public static long previousDay(long date) { return addDays(date, -1); }
/** * Returns the next month. * * @param date Base date * @return next month */ public static long getNextMonth(long date) { return incrementMonth(date, 1); }