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

time_format in field type "text_time" #282

Closed
svenvonarx opened this issue Apr 10, 2015 · 6 comments
Closed

time_format in field type "text_time" #282

svenvonarx opened this issue Apr 10, 2015 · 6 comments

Comments

@svenvonarx
Copy link

In your Wiki i found this in the example of field "text_time": // 'time_format' => 'h:i:s A',

But when I change the format to 24h like this "H:i" or "G:i" it will not affect anything.
The time_format is always the same..

I hope this feature will be fixed soon, or you can tell me what I'm doing wrong now.

Best regards
Sven

@yivi
Copy link
Contributor

yivi commented May 6, 2015

Ditto that. Can't get 'time_format" to work either.

@austinjreilly
Copy link

This might help, although I'm not sure that it will: #226 (comment)

@yivi
Copy link
Contributor

yivi commented May 6, 2015

Thanks @austinjreilly, I can see how you could shortcircuit it that way, but it still doesn't solve the underlaying problem (apparently time_format is ignored, and CMB2 will just use the default values). As far as I can see, you'll just be replacing one default for another, right?

On top of that, the wiki is wrong about the format. It shouldn't use the date format from php, but a time format as documented here. (Not that it matters, since time_format is ignored anyway).

And for my language (Spanish) the translation file is wrong, so it'll give me times with AM/PM, instead of 24hs as we use in Europe. I'll try to submit a corrected po/mo pair for that at least.

Regards!

@yivi
Copy link
Contributor

yivi commented May 7, 2015

Fixing the translation strings helps, but doesn't solve the problem either. Not it works, and the timepicker would let me choose the time in 24hs format, but after saving I get this:
editar_anuncio_ yosilose_com _wordpress
The time is correct (I chose 19:20 before hitting save), but not it displays it in 12hs format, and the time picker wont default to the selected time... But I guess data is saved correctly at least.

A bit confusing...

@yivi
Copy link
Contributor

yivi commented May 7, 2015

Confirmed: Date is saved as "19:20" postmeta, displayed as "7:20 PM" in the metabox (but only after loading the data from the DB), and the timepicker wont choose the correct default value when reading 12hs format from the field and displaying a 24hs format picker...

@jtsternberg
Copy link
Member

This should be good in trunk. Huge thanks for @yivi's work. Please test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants