use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.
the class DateFilterMenu method addYearRange.
private void addYearRange(int yearsAgo) {
int year = new DateWrapper().getFullYear() - yearsAgo;
DateWrapper from = new DateWrapper(year, 0, 1);
DateWrapper to = new DateWrapper(year, 11, 31);
addFixedRange(Integer.toString(year), new DateRange(from.asDate(), to.asDate()));
}
use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.
the class DateUtilGWTImpl method yearRange.
@Override
public DateRange yearRange(int year) {
DateRange range = new DateRange();
DateWrapper date = new DateWrapper(year, 0, 1);
range.setMinDate(date.asDate());
date = new DateWrapper(year, 11, 31);
range.setMaxDate(date.asDate());
return range;
}
use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.
the class MonthlyReportsPanel method addToolBar.
private void addToolBar() {
toolBar = new ActionToolBar();
toolBar.setListener(this);
toolBar.addSaveSplitButton();
toolBar.add(new LabelToolItem(I18N.CONSTANTS.month() + ": "));
monthCombo = new MappingComboBox<>();
monthCombo.setEditable(false);
monthCombo.addListener(Events.Select, new Listener<FieldEvent>() {
@Override
public void handleEvent(FieldEvent be) {
selectStartMonth(monthCombo.getMappedValue());
}
});
DateWrapper today = new DateWrapper();
DateTimeFormat monthFormat = DateTimeFormat.getFormat("MMM yyyy");
for (int year = today.getFullYear() + 2; year != today.getFullYear() - 3; --year) {
for (int month = 12; month != 0; --month) {
DateWrapper d = new DateWrapper(year, month, 1);
Month m = new Month(year, month);
monthCombo.add(m, monthFormat.format(d.asDate()));
}
}
toolBar.add(monthCombo);
toolBar.setDirty(false);
setTopComponent(toolBar);
}
use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.
the class DateUtilGWTImpl method monthRange.
@Override
public DateRange monthRange(int year, int month) {
DateRange range = new DateRange();
DateWrapper date = new DateWrapper(year, month - 1, 1);
range.setMinDate(date.asDate());
date = date.addMonths(1);
date = date.addDays(-1);
range.setMaxDate(date.asDate());
return range;
}
use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.
the class DateFilterMenu method addQuarterRange.
private void addQuarterRange(int year, int quarter) {
DateWrapper from = new DateWrapper(year, quarter * 3, 1);
DateWrapper to = from.addMonths(3).addDays(-1);
addFixedRange(I18N.MESSAGES.quarter(year, (quarter + 1)), new DateRange(from.asDate(), to.asDate()));
}
Aggregations