<?php
/**
 * Helper for a printing date in short form.  
 *
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */

/**
 * The hepler which prints the datetime in short format e.g.
 * 24.11.2007 11:24
 * 
 * @package koubel homepage
 * @author Miroslav Kubelik (koubel@volny.cz)
 * @copyright Copyright (c) 2007-2009 Miroslav Kubelik
 * @license http://opensource.org/licenses/gpl-license.php GNU GPL
 */
class HomeWebApp_View_Helper_CommentDate
{
    /**
     * Main helper method
     * @param string $dtbDate ISO_8601 date format
     * @return string
     */
    public function commentDate($dtbDate,$dateOnly = false)
    {
        $date = new Zend_Date($dtbDate,Zend_Date::ISO_8601);
        if ($dateOnly) return $date->get(Zend_Date::DATES);
        return $date->get(Zend_Date::DATES)." ".$date->get(Zend_Date::TIME_SHORT);
    }
}

