# This is a date_filter plug-in. # START and END are the beginning and end of the quarter specified by date. quarter = { label = "Quarter" usage = "qN/yyyy" regular_expression = "^([Qq]|[Qq][Uu][Aa][Rr][Tt][Ee][Rr])[^-,0-9A-Za-z]?([1-4])[^-,0-9A-Za-z]([0-9]+)$" rewrite = ` int quarter = $2; int year = convert_year($3); # Remember what unit we're using remember_date_unit('quarter'); # Remember the decomposition set_decomposition_year(year); set_decomposition_quarter(quarter); # Get the starting month for the quarter string startmonth = @'templates.util.date_filter.quarters_to_months'{quarter}{'start'}; # Get the ending month for the quarter string endmonth = @'templates.util.date_filter.quarters_to_months'{quarter}{'end'}; startmonth . '/' . year . '-' . endmonth . '/' . year; ` }