help to better help you:

Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!

[SOLVED] Times in 12-Hour vs. 24-Hour on Event Edit

Re: Times in 12-Hour vs. 24-Hour on Event Edit

8 years 6 months ago - 8 years 6 months ago
#22131
[strike]Hi Hoffi,

Thank you for trying to help in this... I tried the code you supplied within helper.php, however it did not change the times to 12-Hour. I am thinking maybe it's looking for an exact match within the JEM Settings in the time formatting, to which I entered my time format in administrator/index.php?option=com_jem&view=settings as %l:%M %P.

Any further modification ideas to make it match? Like maybe if the %P variable is present in the Time Format field of settings?

Looking forward to hearing back from you.[/strike]
Joomla 3.5.1
JEM 2.1.6 stable (with Customization)
PHP: 5.4.45
Last edit: 8 years 6 months ago by rstarkey.

Please Log in or Create an account to join the conversation.

Re: Times in 12-Hour vs. 24-Hour on Event Edit

8 years 6 months ago
#22132
Hoffi,

I made the following change with success.

$format = preg_match('/%[P]/', $timeformat) ? '%l %p' : '%H';

Made the match to P instead if IR, then for my taste changed the Capital i to a lowercase L so that it removes the 0 in front of the number.
Joomla 3.5.1
JEM 2.1.6 stable (with Customization)
PHP: 5.4.45

Please Log in or Create an account to join the conversation.

Re: Times in 12-Hour vs. 24-Hour on Event Edit

8 years 6 months ago
#22135
Hi Robert,

thanks for your feedback. The letters you use (lowercase L and uppercase P) are not working with PHP running on Windows so we can't use them our official release. But for the preg_match you could use the expression '/%[IlrpP]/' which will search for at least one of %I (uppercase i), %l (lowercase L), %r, %p, or %P.

But I think in our official release we need a more universal way. Maybe a new "Hour Format" setting could be a good choice. Then user can specify whatever (s)he likes which is directly used as $format.
The following user(s) said Thank You: rstarkey

Please Log in or Create an account to join the conversation.

Re: [SOLVED] Times in 12-Hour vs. 24-Hour on Event Edit

8 years 6 months ago
#22136
Perfect!!!

Great to know. I'm not a programmer, just a program alter'er. LOL.
Joomla 3.5.1
JEM 2.1.6 stable (with Customization)
PHP: 5.4.45

Please Log in or Create an account to join the conversation.

Re: [SOLVED] Times in 12-Hour vs. 24-Hour on Event Edit

8 years 6 months ago
#22138
rstarkey wrote: I'm not a programmer, just a program alter'er. LOL.
That's a good starting point to become expert. B)

Please Log in or Create an account to join the conversation.

Time to create page: 0.549 seconds