diff --git a/CHANGELOG b/CHANGELOG index 9db3bbb550..c0c7fd4ea3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -10,6 +10,7 @@ Version 1.1.14 work in progress - Bug #1941: yiiactiveform.js form reset now uses CHtml::errorCss instead of a hardcoded value (mdomba) - Bug #1942: CActiveForm client/ajax validation will now remove error class from server side validation (mdomba) - Enh #1847: Added COutputCache::varyByLanguage to generate separate cache for different languages (Obramko) +- Enh #1971: Added CLocale::getHourMeridian defining hour meridian type for the current locale (adminnu) - Chg #645: CDbConnection now throws CDbException when failed to open DB connection instead of failing with a warning (kidol, eirikhm, samdark, cebe) - Chg #1891: Changed order of methods in models generated by Gii and yiic, added better description of search method (hijarian, samdark) - New #1785: Added CPasswordHelper (tom--) diff --git a/framework/i18n/CLocale.php b/framework/i18n/CLocale.php index e744a5ff3b..00ef55eaa3 100644 --- a/framework/i18n/CLocale.php +++ b/framework/i18n/CLocale.php @@ -294,6 +294,14 @@ public function getTimeFormat($width='medium') return $this->_data['timeFormats'][$width]; } + /** + * @return bool hour meridian type, in 12 hour format true, with 24 hour format false + */ + public function getHourMeridian() + { + return strpos($this->getTimeFormat(), 'H:') ? false : true; + } + /** * @return string datetime format, i.e., the order of date and time. */