I corecting date_trunc('quarter',...) and friends because orig version doing '2003-07-30' -> '2003-04-01', '2003-11-30' ->'2003-07-01'