/** * this method must be overriden when implementing other Chronolgy */ protected Chronology getPrimaryChronology() { return datePicker.getChronology(); }
private void goToDate(LocalDate date, boolean focusDayCell) { if (isValidDate(datePicker.getChronology(), date)) { selectedYearMonth.set(YearMonth.from(date)); if (focusDayCell) { findDayCellOfDate(date).requestFocus(); } } }
protected void updateMonthYearPane() { // update date labels YearMonth yearMonth = selectedYearMonth.get(); LocalDate value = datePicker.getValue(); value = value == null ? LocalDate.now() : value; selectedDateLabel.setText(DateTimeFormatter.ofPattern("EEE, MMM dd").format(value)); selectedYearLabel.setText(formatYear(yearMonth)); monthYearLabel.setText(formatMonth(yearMonth) + " " + formatYear(yearMonth)); Chronology chrono = datePicker.getChronology(); LocalDate firstDayOfMonth = yearMonth.atDay(1); backMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, -1, DAYS)); forwardMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, +1, MONTHS)); }
/** * this method must be overriden when implementing other Chronolgy */ protected Chronology getPrimaryChronology() { return datePicker.getChronology(); }
private void goToDate(LocalDate date, boolean focusDayCell) { if (isValidDate(datePicker.getChronology(), date)) { selectedYearMonth.set(YearMonth.from(date)); if (focusDayCell) { findDayCellOfDate(date).requestFocus(); } } }
protected void updateMonthYearPane() { // update date labels YearMonth yearMonth = selectedYearMonth.get(); LocalDate value = datePicker.getValue(); value = value == null ? LocalDate.now() : value; selectedDateLabel.setText(DateTimeFormatter.ofPattern("EEE, MMM dd").format(value)); selectedYearLabel.setText(formatYear(yearMonth)); monthYearLabel.setText(formatMonth(yearMonth) + " " + formatYear(yearMonth)); Chronology chrono = datePicker.getChronology(); LocalDate firstDayOfMonth = yearMonth.atDay(1); backMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, -1, DAYS)); forwardMonthButton.setDisable(!isValidDate(chrono, firstDayOfMonth, +1, MONTHS)); }