function testTimeFormatCustom()
 {
     i18n::set_locale('en_US');
     $this->assertEquals('hh:mm a', i18n::get_time_format());
     i18n::set_time_format('HH:mm:ss');
     $this->assertEquals('HH:mm:ss', i18n::get_time_format());
 }
 public function testTimeFormatCustom()
 {
     i18n::set_locale('en_US');
     $this->assertEquals('h:mm:ss a', i18n::get_time_format());
     i18n::config()->time_format = 'HH:mm:ss';
     $this->assertEquals('HH:mm:ss', i18n::get_time_format());
 }
 function __construct($name, $title = null, $value = "")
 {
     if (!$this->locale) {
         $this->locale = i18n::get_locale();
     }
     if (!$this->getConfig('timeformat')) {
         $this->setConfig('timeformat', i18n::get_time_format());
     }
     parent::__construct($name, $title, $value);
 }
示例#4
0
 /**
  * Override the default getter for TimeFormat so the
  * default format for the user's locale is used
  * if the user has not defined their own.
  * 
  * @return string ISO date format
  */
 public function getTimeFormat()
 {
     if ($this->getField('TimeFormat')) {
         return $this->getField('TimeFormat');
     } elseif ($this->getField('Locale')) {
         require_once 'Zend/Date.php';
         return Zend_Locale_Format::getTimeFormat($this->Locale);
     } else {
         return i18n::get_time_format();
     }
 }