function _quant_build_date_array in Quant 6
Build the date array for charts to fill plotted data on
Parameters
$start: A timestamp representing the day to begin
$steps: The number of steps (days/months) to go back
$interval: A numeric value representing the step size in seconds
$format: The date format to be used in date()
Return value
An array keyed with the date formatted by format. All values are initially set to 0.
2 calls to _quant_build_date_array()
- _quant_build_data_multiple in includes/
data.inc - Generate chart data for a multiple data point over a time period
- _quant_build_data_single in includes/
data.inc - Generate chart data for a singular data point across a time period
File
- includes/
data.inc, line 138 - Functions used to convert Drupal data into chart format
Code
function _quant_build_date_array($start, $steps, $interval, $format) {
$dates = array();
for ($i = 0; $i < $steps; $i++) {
$dates[date($format, $start)] = 0;
$start -= $interval;
// Backtrack a period
}
return $dates;
}