final FieldsetPanel fs = gridBuilder.newFieldset(getString("timePeriod"));
startDate = new DatePanel(fs.newChildId(), new PropertyModel<Date>(filter, "startTime"), DatePanelSettings.get()
.withSelectPeriodMode(true));
fs.add(dependentFormComponents[0] = startDate);
fs.setLabelFor(startDate);
fs.add(new DivTextPanel(fs.newChildId(), " - "));
stopDate = new DatePanel(fs.newChildId(), new PropertyModel<Date>(filter, "stopTime"), DatePanelSettings.get().withSelectPeriodMode(
true));
fs.add(dependentFormComponents[1] = stopDate);
{
final SubmitLink unselectPeriodLink = new SubmitLink(IconLinkPanel.LINK_ID) {
@Override
public void onSubmit()
{
getSearchFilter().setStartTime(null);
getSearchFilter().setStopTime(null);
clearInput();
parentPage.refresh();
};
};
unselectPeriodLink.setDefaultFormProcessing(false);
fs.add(new IconLinkPanel(fs.newChildId(), IconType.REMOVE_SIGN, new ResourceModel("calendar.tooltip.unselectPeriod"),
unselectPeriodLink).setColor(CSSColor.RED));
}
final QuickSelectPanel quickSelectPanel = new QuickSelectPanel(fs.newChildId(), parentPage, "quickSelect", startDate);
fs.add(quickSelectPanel);
quickSelectPanel.init();
fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
return WicketUtils.getCalendarWeeks(TimesheetListForm.this, filter.getStartTime(), filter.getStopTime());
}
}));
fs.add(new HtmlCommentPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
return WicketUtils.getUTCDates(filter.getStartTime(), filter.getStopTime());
}
}));
}
{
// Duration
gridBuilder.newSplitPanel(GridSize.COL33);
final FieldsetPanel fs = gridBuilder.newFieldset(getString("timesheet.totalDuration")).suppressLabelForWarning();
fs.add(new DivTextPanel(fs.newChildId(), new Model<String>() {
@Override
public String getObject()
{
long duration = 0;
if (parentPage.getList() != null) {