Change time format to a.m./p.m. WITH periods, lowercase

More
5 years 9 months ago #135040 by James Riley
Here's a possible work around without having to make changes at a code level, but it involves using another plugin: Regular Labs ReReplacer. "ReReplacer is a Joomla! component and system plugin that enables you to replace anything in your Joomla! site’s output with whatever you want." extensions.joomla.org/extension/edition/replace/rereplacer/

Disclaimer: I think this will work. I have not actually tested it :)
1) In the Date Format, include some kind of date-format-passable fingerprint for ReReplacer to search for after the "a", eg: "g:i a[,:.::-:]". This will keep ReReplacer from accidentally changing text in other places on your site.
2) Set up ReReplacer to change all output of "am[,:,::-:]" to "a.m.", and all output of "pm[,:,::-:]" to "p.m."

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
The following user(s) said Thank You: jgribble

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

  • jgribble
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago #135045 by jgribble
I've used ReReplacer, but not for something like this. Very creative idea. I'll install plugin and play around with it. Love RL apps. Great stuff.
-JG

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

More
5 years 9 months ago #135048 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change time format to a.m./p.m. WITH periods, lowercase
Be careful with that replacer stuff. While it solves the issue, I think it might causes other issue.

For example, It could change the word I am to I a.m. Also, it might have a bit affect with performance (since it needs to search for output of the page to do the replacement)

Regards,

Tuan

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

  • jgribble
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 9 months ago #135049 by jgribble
That's a great point. I may try it down the road; for now I think it's okay how it is; the client hasn't bugged me about it. Others have, they're all different. So for now I'll just let it ride and continue to consider it.
All in all this installation went fabulous. The way you set things up for custom CSS edits is really great. I haven't used EB in a long time and it's been quite a bit improved.
Thanks!
-Jim G.

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

More
5 years 9 months ago #135051 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change time format to a.m./p.m. WITH periods, lowercase
Thanks Jim. Continue working hard to improve the product, make it better from time to time

Tuan

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

More
5 years 9 months ago #135082 by James Riley

Tuan Pham Ngoc wrote: For example, It could change the word I am to I a.m. Also, it might have a bit affect with performance (since it needs to search for output of the page to do the replacement)


Good point, Tuan. There definitely could be a performance hit. It would have to be measured and need to be insubstantial enough to be justifiable.

And you'd definitely NEED to guard against accidental replacements of other text on the site. The idea adding some form of unique "fingerprint" text that I mentioned should prevent that however (appending the "[,:,::-:]" in my example, which date format should pass verbatim and would likely not appear in any other context on any website :) ).

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.

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

More
5 years 9 months ago #135088 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Change time format to a.m./p.m. WITH periods, lowercase
Thanks James. Depends on the requirement, but in this case, I would say it's not needed :)

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

Moderators: Tuan Pham Ngoc