Search in sources :

Example 6 with DateWrapper

use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.

the class DateFilterMenu method addLastFourQuarters.

private void addLastFourQuarters() {
    DateWrapper today = new DateWrapper();
    int year = today.getFullYear();
    int quarter = today.getMonth() / 3;
    for (int i = 0; i < 4; ++i) {
        quarter = quarter - 1;
        if (quarter < 0) {
            year = year - 1;
            quarter = 3;
        }
        addQuarterRange(year, quarter);
    }
}
Also used : DateWrapper(com.extjs.gxt.ui.client.util.DateWrapper)

Example 7 with DateWrapper

use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.

the class MonthlyGrid method formatHeader.

private SafeHtml formatHeader(Month month) {
    DateWrapper date = new DateWrapper(month.getYear(), month.getMonth() - 1, 1);
    String header = monthFormat.format(date.asDate());
    if (locked.apply(month)) {
        header = IconImageBundle.ICONS.lockedPeriodSmall().getHTML() + " " + header;
    }
    return SafeHtmlUtils.fromTrustedString(header);
}
Also used : DateWrapper(com.extjs.gxt.ui.client.util.DateWrapper)

Example 8 with DateWrapper

use of com.extjs.gxt.ui.client.util.DateWrapper in project activityinfo by bedatadriven.

the class MonthlyReportsPanel method getInitialStartMonth.

private Month getInitialStartMonth(SiteDTO site) {
    String stateKey = "monthlyView" + site.getActivityId() + "startMonth";
    if (StateManager.get().getString(stateKey) != null) {
        try {
            return Month.parseMonth(StateManager.get().getString(stateKey));
        } catch (NumberFormatException e) {
        }
    }
    DateWrapper today = new DateWrapper();
    return new Month(today.getFullYear(), today.getMonth());
}
Also used : Month(org.activityinfo.model.type.time.Month) DateWrapper(com.extjs.gxt.ui.client.util.DateWrapper)

Aggregations

DateWrapper (com.extjs.gxt.ui.client.util.DateWrapper)8 DateRange (org.activityinfo.legacy.shared.reports.model.DateRange)4 Month (org.activityinfo.model.type.time.Month)2 FieldEvent (com.extjs.gxt.ui.client.event.FieldEvent)1 LabelToolItem (com.extjs.gxt.ui.client.widget.toolbar.LabelToolItem)1 DateTimeFormat (com.google.gwt.i18n.client.DateTimeFormat)1 ActionToolBar (org.activityinfo.ui.client.page.common.toolbar.ActionToolBar)1