*** empty log message ***
This commit is contained in:
parent
c7ba993c18
commit
5f5a6c65b5
25 changed files with 280 additions and 91 deletions
|
@ -55,17 +55,34 @@ class uiScheduler extends uiCalendar
|
|||
function _datetime2timestamp($i)
|
||||
{
|
||||
$formatted = $i[0].$i[1].$i[2].$i[3].'-'.$i[4].$i[5].'-'.$i[6].$i[7].strrchr($i, 'T');
|
||||
#echo "iiiii: $i ffff:".$formatted;
|
||||
return strtotime($formatted);
|
||||
#echo "input: $i formatted:".$formatted;
|
||||
return $this->_strtotime($formatted);
|
||||
}
|
||||
|
||||
|
||||
function _strtotime($input)
|
||||
{
|
||||
## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !!
|
||||
if (strpos($input, 'T'))
|
||||
return strtotime($input)-8*3600;
|
||||
return strtotime($input);
|
||||
}
|
||||
|
||||
|
||||
function getDayUsage($year, $month, $day)
|
||||
{
|
||||
$day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00');
|
||||
$day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59');
|
||||
|
||||
$date = $year.$month.$day;
|
||||
$arr = $this->displayScheduleMethod($date.'T00:00:00', $date.'T23:59:59.999999');
|
||||
if (!count($arr))
|
||||
return FALSE;
|
||||
foreach ($arr as $key=>$val) {
|
||||
$arr[$key]['title'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE);
|
||||
$arr[$key]['creator'] = $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR);
|
||||
$arr[$key]['timestamp'] = $this->_datetime2timestamp($val['start']);
|
||||
}
|
||||
#print_r($arr);
|
||||
return $arr;
|
||||
}
|
||||
|
@ -84,46 +101,46 @@ class uiScheduler extends uiCalendar
|
|||
|
||||
function getDayTiming($year, $month, $day)
|
||||
{
|
||||
## !! bug in strtotime. zeigt 8h später an als reines datum, wenn Txx:xx:xx verwendet wird !!
|
||||
#echo $year.$month.$day;
|
||||
$day_start = $this->_datetime2timestamp($year.$month.$day.'T00:00:00');
|
||||
$day_end = $this->_datetime2timestamp($year.$month.$day.'T23:59:59');
|
||||
|
||||
if (!$arr = $this->getDayUsage($year, $month, $day))
|
||||
return array(array( ## empty day
|
||||
return array(array( ## empty day
|
||||
'type' => 'gap',
|
||||
'length' => $day_end - $day_start
|
||||
));
|
||||
|
||||
$curr = current($arr);
|
||||
if (strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00
|
||||
if ($this->_strtotime($curr['start']) > $day_start) ## insert gap if first entry start after 00:00:00
|
||||
$list[] = array(
|
||||
'type' => 'gap',
|
||||
#'pos' => 0,
|
||||
'length' => strtotime($curr['start']) - $day_start
|
||||
'length' => $this->_strtotime($curr['start']) - $day_start
|
||||
);
|
||||
|
||||
while ($curr = current($arr)) {
|
||||
$list[] = array(
|
||||
'type' => 'entry',
|
||||
#'pos' => strtotime($curr['start']) - $day_start,
|
||||
'length' => strtotime($curr['end']) - strtotime($curr['start']),
|
||||
#'pos' => $this->_strtotime($curr['start']) - $day_start,
|
||||
'length' => $this->_strtotime($curr['end']) - $this->_strtotime($curr['start']),
|
||||
'entry' => $curr
|
||||
);
|
||||
|
||||
if ($next = next($arr)) {
|
||||
if (strtotime($next['start']) > strtotime($curr['end'])+1) ## insert gap between entrys
|
||||
if ($this->_strtotime($next['start']) > $this->_strtotime($curr['end'])+1) ## insert gap between entrys
|
||||
$list[] = array(
|
||||
'type' => 'gap',
|
||||
#'pos' => strtotime($curr['start'])-$day_start,
|
||||
'length' => strtotime($next['start']) - strtotime($curr['end']),
|
||||
#'pos' => $this->_strtotime($curr['start'])-$day_start,
|
||||
'length' => $this->_strtotime($next['start']) - $this->_strtotime($curr['end']),
|
||||
);
|
||||
}
|
||||
else {
|
||||
if (strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight
|
||||
if ($this->_strtotime($curr['end']) < $day_end) ## insert gap if prev entry was not until midnight
|
||||
$list[] = array(
|
||||
'type' => 'gap',
|
||||
#'pos' => strtotime($curr['end']) - $day_start,
|
||||
'length' => $day_end - strtotime($curr['end']),
|
||||
#'pos' => $this->_strtotime($curr['end']) - $day_start,
|
||||
'length' => $day_end - $this->_strtotime($curr['end']),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -138,6 +155,7 @@ class uiScheduler extends uiCalendar
|
|||
return $id < 1 ? ceil($in) : round($in);
|
||||
}
|
||||
|
||||
|
||||
function _scheduledDays($period)
|
||||
{
|
||||
if ($period=='month') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue