Spanish Date (th suffix)

9 posts by 3 authors in: Forums > CMS Builder
Last Post: January 7, 2015   (RSS)

By Jesus - January 6, 2015

Hi,

Is there a way to remove the th suffix from the date fields? I use normally my dates in Spanish so I don't need the th suffix on the dates.

So in place of 25th Jun, 2007 I'll like to have/show Jun 25, 2007

Thanks for pointing me to the right direction.

Jesus

By claire - January 6, 2015

Hey there

Is this in the front end or in the CMS? In the front end, you can use the date() PHP function to construct the date however you like.

Say you have a date like 25th Jun, 2007 and you want to convert it to remove the suffix. You would use the date function like so:

<?php echo date('M j, Y', strtotime('25th Jun, 2007')); ?>

strtotime() is important because it converts date strings into UNIX timestamps which the date() function requires in order to work.

Here's the function reference for date(): http://php.net/manual/en/function.date.php

You can see that you have many more options for rendering dates exactly how you want them to look. The 'M j, Y' string at the start tells the function how you want to show the date and which parts you want to include.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - January 6, 2015

Hi Claire, thanks for your quick answer.

I've this issue on the backend. Thanks again for your help!

Jesus

By claire - January 6, 2015

Okay, it might still be possible to show the dates as you like. Can you attach a screenshot of where this date shows up?

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - January 6, 2015

Sure, thanks.

By claire - January 6, 2015

Thank you. I'm afraid it's not possible to change the display through the CMS, but I believe we could write a small plugin to alter how the dates appear in the list. If you'd like us to do this, please email consulting@interactivetools.com and we can send you a quote for the work.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jesus - January 6, 2015

Thank you Claire, if I remember correctly there was a tool to fix this in the old AM2, am I correct?

Any chance to get something like that? Because for Spanish speaking people, the th suffix really doesn't work.

Jesus

By claire - January 6, 2015

I'll refer this to Damon, he knows AM2 much better than I would. He may have another solution.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/