+ <!-- Comparative time range selection -->
+ <widget-family name="comparative-timerange" datatype="timestamptz">
+ <label>Comparative time-range widgets</label>
+
+ <widget name="month">
+ <label>Compare runtime relative time months</label>
+ <description>
+ This widget allows the user to pick an arbitrary time range
+ on which to report.
+ </description>
+ <filter-code type="perl">
+ $full_col = "DATE_TRUNC('month', $full_col)";
+ $where_clause =
+ "( $full_col = DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) ".
+ " OR $full_col = DATE_TRUNC('month', NOW() - CAST( ? || ' month' AS INTERVAL )) )";
+ push @$bind_list, $$val{target}, $$val{target} + $$val{compare};
+ </filter-code>
+ </widget>
+ </widget-family>