@Override public void refresh() { firstDisplayed = getModel().getCurrentFirstDayOfFirstWeek(); if (firstDisplayed.getDate() == 1) { // show one empty week if date is Monday is the first in month. addDays(firstDisplayed, -7); } lastDisplayed.setTime(firstDisplayed.getTime()); for (int i = 0; i < grid.getNumCells(); i++) { if (i != 0) { addDays(lastDisplayed, 1); } DateCell cell = (DateCell) grid.getCell(i); cell.update(lastDisplayed); } setAriaSelectedCell(null); }
private DateCell getCell(Date d) { int index = CalendarUtil.getDaysBetween(firstDisplayed, d); if (index < 0 || grid.getNumCells() <= index) { return null; } DateCell cell = (DateCell) grid.getCell(index); if (cell.getValue().getDate() != d.getDate()) { throw new IllegalStateException(d + " cannot be associated with cell " + cell + " as it has date " + cell.getValue()); } return cell; } }
@Override public void refresh() { firstDisplayed = getModel().getCurrentFirstDayOfFirstWeek(); if (firstDisplayed.getDate() == 1) { // show one empty week if date is Monday is the first in month. addDays(firstDisplayed, -7); } lastDisplayed.setTime(firstDisplayed.getTime()); for (int i = 0; i < grid.getNumCells(); i++) { if (i != 0) { addDays(lastDisplayed, 1); } DateCell cell = (DateCell) grid.getCell(i); cell.update(lastDisplayed); } setAriaSelectedCell(null); }
@Override public void refresh() { firstDisplayed = getModel().getCurrentFirstDayOfFirstWeek(); if (firstDisplayed.getDate() == 1) { // show one empty week if date is Monday is the first in month. addDays(firstDisplayed, -7); } lastDisplayed.setTime(firstDisplayed.getTime()); for (int i = 0; i < grid.getNumCells(); i++) { if (i != 0) { addDays(lastDisplayed, 1); } DateCell cell = (DateCell) grid.getCell(i); cell.update(lastDisplayed); } setAriaSelectedCell(null); }
private DateCell getCell(Date d) { int index = CalendarUtil.getDaysBetween(firstDisplayed, d); if (index < 0 || grid.getNumCells() <= index) { return null; } DateCell cell = (DateCell) grid.getCell(index); if (cell.getValue().getDate() != d.getDate()) { throw new IllegalStateException(d + " cannot be associated with cell " + cell + " as it has date " + cell.getValue()); } return cell; } }
private DateCell getCell(Date d) { int index = CalendarUtil.getDaysBetween(firstDisplayed, d); if (index < 0 || grid.getNumCells() <= index) { return null; } DateCell cell = (DateCell) grid.getCell(index); if (cell.getValue().getDate() != d.getDate()) { throw new IllegalStateException(d + " cannot be associated with cell " + cell + " as it has date " + cell.getValue()); } return cell; } }