# This is a date_filter plug-in. # START is the beginning of the first part of the range; end is the end of the last part of the range range = { label = "range" usage = "X-Y" regular_expression = "^([^-]+)-([^-]+)$" start = ` string rangestart = $1; # Allow a divider surrounding the - in the range if (matches_regular_expression(rangestart, '^(.*)[^-,0-9A-Za-z]$')) then rangestart = $1; #error('x'); # Save the range start, so we can use it from the end if we need to. v.date_filter_range_start = rangestart; #v.start_of_range = true; # Compute the start of the range recursively node dfi = new_node(); get_date_filter_info(rangestart, dfi, true, v.earliest_log_date, v.latest_log_date); #echo("sub dfi for start '" . rangestart . "': " . node_as_string(dfi)); string earliest_relative_date = @dfi{'earliest_relative_date'}; delete_node(dfi); if (?'v.decomposition') then clone_node('v.decomposition', 'v.decomposition_start'); #echo("start: " . node_as_string('v.decomposition_start')); earliest_relative_date; ` end = ` string rangeend = $2; #v.end_of_range = true; # Allow a divider surrounding the - in the range if (matches_regular_expression(rangeend, '^[^-,0-9A-Za-z](.*)$')) then rangeend = $1; # Compute the end of the range recursively node dfi = new_node(); get_date_filter_info(rangeend, dfi, true, v.earliest_log_date, v.latest_log_date); #echo("sub dfi for end '" . rangeend . "': " . node_as_string(dfi)); string latest_relative_date = @dfi{'latest_relative_date'}; delete_node(dfi); if (?'v.decomposition') then clone_node('v.decomposition', 'v.decomposition_end'); #echo("end: " . node_as_string('v.decomposition_end')); latest_relative_date; ` }