# This is a date_filter plug-in. # START and END are the beginning and end of the month specified by date. month = { label = "Month" usage = "mmm/yyyy" regular_expression = "^([A-Za-z]+)[^-,0-9A-Za-z]?([0-9][0-9]|[0-9][0-9][0-9][0-9])$" start = ` # Remember what unit we're using remember_date_unit('month'); string year = $2; string month = $1; year = convert_year(year); month = convert_month(month); # Remember the decomposition set_decomposition_month(month); set_decomposition_year(year); '01/' . month . '/' . year . ' 00:00:00' ` end = ` # Remember what unit we're using remember_date_unit('month'); string year = $2; string month = $1; year = convert_year(year); month = convert_month(month); string start = '01/' . month . '/' . year . ' 00:00:00'; int start_epoc = date_time_to_epoc(start); int start_epoc_plus_month = start_epoc + 31 * 24 * 3600; string second_in_next_month = epoc_to_date_time(start_epoc_plus_month); string beginning_of_next_month = '01/' . substr(second_in_next_month,3); int beginning_of_next_month_epoc = date_time_to_epoc(beginning_of_next_month); int end_of_this_month_epoc = beginning_of_next_month_epoc -1; epoc_to_date_time(end_of_this_month_epoc); ` }