Getting the time format (24/12) #1971

Closed
adminnu opened this Issue Jan 13, 2013 · 8 comments

Comments

3 participants
Contributor

adminnu commented Jan 13, 2013

For example:
strpos(Yii::app()->locale->getTimeFormat(), 'H:') !== false ? false : true

Owner

samdark commented Jan 13, 2013

What exactly you're proposing here?

@adminnu adminnu added a commit to adminnu/yii that referenced this issue Jan 13, 2013

@adminnu adminnu Enh #1971: Added CLocale::getHourMeridian defining hour meridian type…
… for the current locale
40b5025
Member

mdomba commented Jan 13, 2013

This method makes no sense and is not intuitive... returns true/false for 12/24h format ???

Contributor

adminnu commented Jan 13, 2013

For example, this feature can be used to specify the type for the meridian hour https://github.com/clevertech/YiiBooster/blob/master/widgets/TbTimePicker.php#L29. Or taken from the locale or a setting.

Contributor

adminnu commented Jan 13, 2013

@mdomba This functionality really required for many timepicker, who are just beginning to emerge. If the format of true / false is bad, tell what will be the best for this method.

Member

mdomba commented Jan 13, 2013

I did not encounter yet this need so I don't know about this...

in YiiBooster case there is true/false for 12/24 hour format, are you sure it's the same for those other emerging timepickers?

If it's not a standard why not just use strpos(Yii::app()->locale->getTimeFormat(), 'H:') in your case.

Contributor

adminnu commented Jan 13, 2013

I just offered this functionality, this method seemed to me important.
For example it can also be used here:
https://github.com/adminnu/yii/blob/40b50259d40861e01d5810be8c7ca007673eb71e/framework/i18n/CDateFormatter.php#L372
https://github.com/adminnu/yii/blob/40b50259d40861e01d5810be8c7ca007673eb71e/framework/i18n/CDateFormatter.php#L391
I also think it may be necessary to determine the type of hours, depending on the locale and elsewhere.

Contributor

adminnu commented Jan 13, 2013

such similar functionality: #1972
which also is used only to determine the first day of the week on the calendar, just calendars today are very well developed, and there is no time.

Contributor

adminnu commented Jan 13, 2013

Then decides it is necessary, obavlyaem, do not, I close my ticket.

samdark closed this Nov 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment