mirror of
https://github.com/beestat/app.git
synced 2026-06-08 07:15:16 -04:00
Fixed runtime_thermostat_summary->read not supporting date ranges
This commit is contained in:
@@ -61,21 +61,32 @@ class runtime_thermostat_summary extends cora\crud {
|
||||
$base = strtotime('+' . $date_time->getOffset() . ' seconds');
|
||||
}
|
||||
|
||||
// If a date was given, apply the base time adjustment to correct for time
|
||||
// zones.
|
||||
if(isset($attributes['date']) === true) {
|
||||
if(is_array($attributes['date']) === true) {
|
||||
$attributes['date']['value'] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date']['value'], $base)
|
||||
);
|
||||
} else {
|
||||
$attributes['date'] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date'], $base)
|
||||
);
|
||||
}
|
||||
}
|
||||
// If a date was given, apply the base time adjustment to correct for time
|
||||
// zones.
|
||||
if(isset($attributes['date']) === true) {
|
||||
if(is_array($attributes['date']) === true) {
|
||||
if(is_array($attributes['date']['value']) === true) {
|
||||
$attributes['date']['value'][0] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date']['value'][0], $base)
|
||||
);
|
||||
$attributes['date']['value'][1] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date']['value'][1], $base)
|
||||
);
|
||||
} else {
|
||||
$attributes['date']['value'] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date']['value'], $base)
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$attributes['date'] = date(
|
||||
'Y-m-d',
|
||||
strtotime($attributes['date'], $base)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$runtime_thermostat_summaries = array_merge(
|
||||
$runtime_thermostat_summaries,
|
||||
@@ -91,12 +102,12 @@ class runtime_thermostat_summary extends cora\crud {
|
||||
$runtime_thermostat_summary['sum_heating_degree_days'] /= 10;
|
||||
$runtime_thermostat_summary['sum_cooling_degree_days'] /= 10;
|
||||
}
|
||||
|
||||
return $runtime_thermostat_summaries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate from the max populated date until now.
|
||||
|
||||
return $runtime_thermostat_summaries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Populate from the max populated date until now.
|
||||
*
|
||||
* @param int $thermostat_id
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user