From 74b5aeb769cae8445e78988d625ea805a810173e Mon Sep 17 00:00:00 2001 From: mattf Date: Fri, 9 Dec 2016 12:07:30 +0000 Subject: [PATCH] fix for recent report git-svn-id: svn://192.168.202.10@2646 3d104415-ff17-0410-8863-d5cf3c621b8a --- agc_2-X/trunk/www/vicidial/functions.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/agc_2-X/trunk/www/vicidial/functions.php b/agc_2-X/trunk/www/vicidial/functions.php index ae4af200..1d88852c 100644 --- a/agc_2-X/trunk/www/vicidial/functions.php +++ b/agc_2-X/trunk/www/vicidial/functions.php @@ -1334,4 +1334,23 @@ function hex2rgb($hex) { return $rgb; // returns an array with the rgb values } +function createDateRangeArray($strDateFrom,$strDateTo) + { + $aryRange=array(); + + $iDateFrom=mktime(1,0,0,substr($strDateFrom,5,2), substr($strDateFrom,8,2),substr($strDateFrom,0,4)); + $iDateTo=mktime(1,0,0,substr($strDateTo,5,2), substr($strDateTo,8,2),substr($strDateTo,0,4)); + + if ($iDateTo>=$iDateFrom) + { + array_push($aryRange,date('Y-m-d',$iDateFrom)); // first entry + while ($iDateFrom<$iDateTo) + { + $iDateFrom+=86400; // add 24 hours + array_push($aryRange,date('Y-m-d',$iDateFrom)); + } + } + return $aryRange; + } + ?>