corrected span-over hour/midnight display
This commit is contained in:
parent
9236c4671a
commit
f6ef66b894
2 changed files with 50 additions and 19 deletions
|
@ -27,6 +27,17 @@
|
|||
</td>
|
||||
<td style="border-right: 1px solid #ccc;">
|
||||
{if $_entrys[$_hour].end}
|
||||
{foreach from=$_entrys[$_hour].end item="i"}
|
||||
{if $i.startsyesterday}
|
||||
<div {include file="scheduler/removeitem.tpl"}>
|
||||
<img src="img/playlist.png" border="0" {include file="sub/alttext.tpl"}>
|
||||
|
||||
<b>{$i.title}</b>
|
||||
##yesterday## {$i.start} - {$i.end}
|
||||
<i>{$i.creator}</i>
|
||||
</div>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{include file="scheduler/between_additem.tpl"}
|
||||
{/if}
|
||||
|
||||
|
@ -36,11 +47,17 @@
|
|||
<img src="img/playlist.png" border="0" {include file="sub/alttext.tpl"}>
|
||||
|
||||
<b>{$i.title}</b>
|
||||
|
||||
{if $i.endstoday}
|
||||
{$i.start} - {$i.end}
|
||||
{$i.creator}
|
||||
<i>{$i.creator}</i>
|
||||
{if $i.endshere}
|
||||
{include file="scheduler/between_additem.tpl"}
|
||||
{/if}
|
||||
{else}
|
||||
{$i.start} - ##tomorrow## {$i.end}
|
||||
<i>{$i.creator}</i>
|
||||
{/if}
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
|
|
@ -235,7 +235,7 @@ class uiScheduler extends uiCalendar
|
|||
$h = number_format(strftime('%H', $start));
|
||||
$M = number_format(strftime('%i', $start));
|
||||
|
||||
## item starts today -> put metadata to array
|
||||
## item starts today
|
||||
if (strftime('%Y%m%d', $start) === $thisDay) {
|
||||
$items[number_format(strftime('%H', $start))]['start'][] = array(
|
||||
'id' => $this->Base->gb->_idFromGunid($val['playlistId']),
|
||||
|
@ -245,16 +245,30 @@ class uiScheduler extends uiCalendar
|
|||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'type' => 'Playlist',
|
||||
'endstoday' => strftime('%d', $start) === strftime('%d', $end) ? TRUE : FALSE,
|
||||
'endshere' => strftime('%H', $start) === strftime('%H', $end) ? TRUE : FALSE
|
||||
);
|
||||
}
|
||||
|
||||
/* mark the span as in use
|
||||
for ($n = number_format(strftime('%H', $start))+1; $n <= number_format(strftime('%H', $end)); $n++) {
|
||||
$items['span'][$n] = TRUE;
|
||||
} */
|
||||
## item which end today
|
||||
}
|
||||
*/
|
||||
|
||||
## item ends today
|
||||
if (strftime('%Y%m%d', $end) === $thisDay && strftime('%H', $start) !== strftime('%H', $end)) {
|
||||
$items[number_format(strftime('%H', $end))]['end'] = TRUE;
|
||||
$items[number_format(strftime('%H', $end))]['end'][] =
|
||||
array(
|
||||
'id' => $this->Base->gb->_idFromGunid($val['playlistId']),
|
||||
'scheduleid'=> $val['id'],
|
||||
'start' => substr($val['start'], strpos($val['start'], 'T')+1),
|
||||
'end' => substr($val['end'], strpos($val['end'], 'T') + 1),
|
||||
'title' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_TITLE),
|
||||
'creator' => $this->Base->_getMDataValue($this->Base->gb->_idFromGunid($val['playlistId']), UI_MDATA_KEY_CREATOR),
|
||||
'type' => 'Playlist',
|
||||
'startsyesterday' => strftime('%d', $start) === strftime('%d', $end) ? FALSE : TRUE,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue