Search in sources :

Example 1 with ExpandTimePeriodAdjuster

use of com.infiniteautomation.mango.rest.v2.util.ExpandTimePeriodAdjuster in project ma-modules-public by infiniteautomation.

the class ZonedDateTimeRangeQueryInfo method setupDates.

/**
 * Round off the period for rollups
 */
protected void setupDates() {
    // Round off the period if we are using periodic rollup
    if (this.timePeriod != null) {
        TruncateTimePeriodAdjuster adj = new TruncateTimePeriodAdjuster(TimePeriodType.convertFrom(this.timePeriod.getType()), this.timePeriod.getPeriods());
        from = from.with(adj);
        ExpandTimePeriodAdjuster expander = new ExpandTimePeriodAdjuster(from, TimePeriodType.convertFrom(this.timePeriod.getType()), this.timePeriod.getPeriods());
        to = to.with(expander);
    }
}
Also used : ExpandTimePeriodAdjuster(com.infiniteautomation.mango.rest.v2.util.ExpandTimePeriodAdjuster) TruncateTimePeriodAdjuster(com.infiniteautomation.mango.util.datetime.TruncateTimePeriodAdjuster)

Aggregations

ExpandTimePeriodAdjuster (com.infiniteautomation.mango.rest.v2.util.ExpandTimePeriodAdjuster)1 TruncateTimePeriodAdjuster (com.infiniteautomation.mango.util.datetime.TruncateTimePeriodAdjuster)1