Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Open
wants to merge 2 commits into from

2 participants

@cebe
Owner

"HourMeridian" sounds weird to me, how do you get to that name?

@adminnu

I have taken from here: https://github.com/clevertech/YiiBooster/blob/master/widgets/TbTimePicker.php#L29
Could not pick up the normal word for it. You can still getHourType example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 13, 2013
  1. @adminnu

    Enh #1971: Added CLocale::getHourMeridian defining hour meridian type…

    adminnu authored
    … for the current locale
Commits on Jan 19, 2013
  1. @adminnu
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 0 deletions.
  1. +1 −0  CHANGELOG
  2. +8 −0 framework/i18n/CLocale.php
View
1  CHANGELOG
@@ -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--)
View
8 framework/i18n/CLocale.php
@@ -295,6 +295,14 @@ public function getTimeFormat($width='medium')
}
/**
+ * @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.
*/
public function getDateTimeFormat()
Something went wrong with that request. Please try again.