public function formatUntil(\MUtil_Date $dateTime = null)
    {
        if (false === $this->showUntil) { return; }
        
        if (null === $dateTime) {
            return $this->_('Survey has no time limit.');
        }

        $days = $dateTime->diffDays();

        switch ($days) {
            case 0:
                return array(
                    \MUtil_Html::create('strong', $this->_('Warning!!!')),
                    ' ',
                    $this->_('This survey must be answered today!')
                    );

            case 1:
                return array(
                    \MUtil_Html::create('strong', $this->_('Warning!!')),
                    ' ',
                    $this->_('This survey can only be answered until tomorrow!')
                    );

            case 2:
                return $this->_('Warning! This survey can only be answered for another 2 days!');

            default:
                if ($days <= 14) {
                    return sprintf($this->_('Please answer this survey within %d days.'), $days);
                }

                if ($days <= 0) {
                    return $this->_('This survey can no longer be answered.');
                }

                return sprintf($this->_('Please answer this survey before %s.'), $dateTime->toString($this->dateFormat));
        }
    }
public function formatUntil(\MUtil_Date $dateTime = null)
    {
        if (false === $this->showUntil) { return; }
        
        if (null === $dateTime) {
            return $this->_('Survey has no time limit.');
        }

        $days = $dateTime->diffDays();

        switch ($days) {
            case 0:
                return array(
                    \MUtil_Html::create('strong', $this->_('Warning!!!')),
                    ' ',
                    $this->_('This survey must be answered today!')
                    );

            case 1:
                return array(
                    \MUtil_Html::create('strong', $this->_('Warning!!')),
                    ' ',
                    $this->_('This survey can only be answered until tomorrow!')
                    );

            case 2:
                return $this->_('Warning! This survey can only be answered for another 2 days!');

            default:
                if ($days <= 14) {
                    return sprintf($this->_('Please answer this survey within %d days.'), $days);
                }

                if ($days <= 0) {
                    return $this->_('This survey can no longer be answered.');
                }

                return sprintf($this->_('Please answer this survey before %s.'), $dateTime->toString($this->dateFormat));
        }
    }
public function formatUntil ( \ MUtil_Date $ dateTime = null ) { if ( false === $ this -> showUntil ) { return ; } if ( null === $ dateTime ) { return $ this -> _ ( 'Survey has no time limit.' ) ; } $ days = $ dateTime -> diffDays ( ) ; switch ( $ days ) { case 0 : return array ( \ MUtil_Html :: create ( 'strong' , $ this -> _ ( 'Warning!!!' ) ) , ' ' , $ this -> _ ( 'This survey must be answered today!' ) ) ; case 1 : return array ( \ MUtil_Html :: create ( 'strong' , $ this -> _ ( 'Warning!!' ) ) , ' ' , $ this -> _ ( 'This survey can only be answered until tomorrow!' ) ) ; case 2 : return $ this -> _ ( 'Warning! This survey can only be answered for another 2 days!' ) ; default : if ( $ days <= 14 ) { return sprintf ( $ this -> _ ( 'Please answer this survey within %d days.' ) , $ days ) ; } if ( $ days <= 0 ) { return $ this -> _ ( 'This survey can no longer be answered.' ) ; } return sprintf ( $ this -> _ ( 'Please answer this survey before %s.' ) , $ dateTime -> toString ( $ this -> dateFormat ) ) ; } }
Formats an until date for this display

@param \MUtil_Date $dateTime
@return string
Formats an until date for this display