Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh #1971: Added CLocale::getHourMeridian defining hour meridian type for the current locale #1972

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -11,6 +11,7 @@ Version 1.1.14 work in progress
- Bug #1942: CActiveForm client/ajax validation will now remove error class from server side validation (mdomba)
- Bug #1984: CDbMigration: fix of undeclared variable usage in debug information in dropPrimaryKey (papulovskiy)
- 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--)
Expand Down
8 changes: 8 additions & 0 deletions framework/i18n/CLocale.php
Expand Up @@ -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.
*/
Expand Down