@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 setup() { CellFormatter formatter = grid.getCellFormatter(); int weekendStartColumn = -1; int weekendEndColumn = -1; int dayIdx = i + shift < CalendarModel.DAYS_IN_WEEK ? i + shift : i + shift - CalendarModel.DAYS_IN_WEEK; grid.setText(0, i, getModel().formatDayOfWeek(dayIdx)); DateCell cell = grid.new DateCell(column == weekendStartColumn || column == weekendEndColumn); grid.setWidget(row, column, cell); grid.setStyleName(css().days());
@Override public void setup() { CellFormatter formatter = grid.getCellFormatter(); int weekendStartColumn = -1; int weekendEndColumn = -1; int dayIdx = i + shift < CalendarModel.DAYS_IN_WEEK ? i + shift : i + shift - CalendarModel.DAYS_IN_WEEK; grid.setText(0, i, getModel().formatDayOfWeek(dayIdx)); DateCell cell = grid.new DateCell(column == weekendStartColumn || column == weekendEndColumn); grid.setWidget(row, column, cell); grid.setStyleName(css().days());
@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); }
CellGrid() { resize(CalendarModel.WEEKS_IN_MONTH + 1, CalendarModel.DAYS_IN_WEEK); }
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; } }
CellGrid() { resize(CalendarModel.WEEKS_IN_MONTH + 1, CalendarModel.DAYS_IN_WEEK); }
@Override public void setup() { CellFormatter formatter = grid.getCellFormatter(); int weekendStartColumn = -1; int weekendEndColumn = -1; int dayIdx = i + shift < CalendarModel.DAYS_IN_WEEK ? i + shift : i + shift - CalendarModel.DAYS_IN_WEEK; grid.setText(0, i, getModel().formatDayOfWeek(dayIdx)); DateCell cell = grid.new DateCell(column == weekendStartColumn || column == weekendEndColumn); grid.setWidget(row, column, cell); grid.setStyleName(css().days());
CellGrid() { resize(CalendarModel.WEEKS_IN_MONTH + 1, CalendarModel.DAYS_IN_WEEK); }
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; } }