{extends file=$smarty.const.SMARTY_LAYOUT_CONTENT_LIST_TABLE_CURRENT_DATA}

{block name="listing-td-content-title"}
	{calendarEventLabel ref=$rowFields['id']}
{/block}

{block name="listing-td-content-alertDateTime"}
	{$rowFields['alertDateTime']|dateTimeFormat:"dateWithHMS"}
{/block}

{block name="listing-td-content-startDateTime"}
	{$startDateTimeObj = \Engine\DateTime::createFromIsoDatetime($rowFields['startDateTime'])}
	{$endDateTimeObj = \Engine\DateTime::createFromIsoDatetime($rowFields['endDateTime'])}
	{$stampDiff = ($endDateTimeObj->formatTime() - $startDateTimeObj->formatTime())}
	
	{if $rowFields['allDay']}
		{$rowFields['startDateTime']|dateTimeFormat:"dateWithHM"} ({$_LANG['Utils']['Calendar']['Listing']['formFields']['allDay']})
	{else}
		{if $stampDiff < 86400 && $stampDiff > 0} 
			{* under a day *}
			
			{$rowFields['startDateTime']|dateTimeFormat:"dateWithHM"}
			{if $stampDiff/3600 < 1}
				{* under one hour*}
				+{$stampDiff/60} {$_LANG['Utils']['Calendar']['Listing']['index']['listCols']['minutes']}
			{else}
				+{($stampDiff/3600)|round:1} {$_LANG['Utils']['Calendar']['Listing']['index']['listCols']['hours']}
			{/if}
			
		{elseif $stampDiff >= 86400}
			{$rowFields['startDateTime']|dateTimeFormat:"dateWithHM"} - {$rowFields['endDateTime']|dateTimeFormat:"dateWithHM"}
		{/if}
	{/if}
	
{/block}

{block name="listing-td-content-dismissDateTime"}
	{$rowFields['dismissDateTime']|dateTimeFormat:"dateWithHMS"}
{/block}

{block name="listing-td-content-addTime"}
	{$rowFields['addTime']|dateTimeFormat:"dateWithHMS"}
{/block}

{block name="listing-td-content-idUser"}
	{userLabel ref=$rowFields['idUser']}
{/block}

