Date format

Permalink 2 users found helpful
Hi Guys

Sorry if this has been asked before but can't find it.

I herd when the latest C5 build came out we would be able to change the date format for European countries to d.m.y. is this the case? If so where can I find the option?

Thanks!

senshidigital
 
senshidigital replied on at Permalink Reply
senshidigital
anyone?
12345j replied on at Permalink Reply
12345j
change the date for what?
senshidigital replied on at Permalink Reply
senshidigital
Soem add-on creators say that the dates they used are pulled from the core system so to change to d-m-y it will need to change in the core. I remember someone saying when the later C5 was released there would be a feature to change the date format.

If this is the case where is it?

I have tried codes etc in the config file but can't seem to get it to work.
12345j replied on at Permalink Reply
12345j
I don't know, but couldn't you look into those blocks and see where they're calling their date from? blogga is an example that uses dates, see where its calling to and then go there. wouldn't that work?
senshidigital replied on at Permalink Reply
senshidigital
I have managed to change the date on some add-ons like simple blog etc.

Extended form add-on for example does not seem to allow you to change this in its code, but runs off the core.
12345j replied on at Permalink Reply
12345j
but extended form must have code that calls the date from the core, right? wouldn't that show you where it is in the core?
senshidigital replied on at Permalink Reply
senshidigital
yeah... i think i tried to change it at one point but it screwed with everything.

just thought there might be an option for this now.

ahh well.
Mnkras replied on at Permalink Best Answer Reply
Mnkras
define('DATE_APP_GENERIC_MDYT_FULL', t('F d, Y \a\t g:i A'));
   define('DATE_APP_GENERIC_MDYT', t('n/j/Y \a\t g:i A'));
   define('DATE_APP_GENERIC_MDY', 'Y-m-d');
   define('DATE_APP_GENERIC_MDY', t('n/j/Y'));
   define('DATE_APP_GENERIC_MDY_FULL', t('F d, Y'));
   define('DATE_APP_GENERIC_T', t('g:i A'));
   define('DATE_APP_GENERIC_TS', t('g:i:s A'));
openly replied on at Permalink Reply
openly
thanks Mnkras very helpful
ecomatt replied on at Permalink Reply
ecomatt
has anyone managed to get this to work mnkras is what you posted the USA version and from that it needs to be changed?

my head is spinning with code - can anyone get this working there are so many threads and still no concrete (no pun intend) way of achieving this.

thanks
senshidigital replied on at Permalink Reply
senshidigital
OK placing:

define('DATE_APP_GENERIC_MDY', 'd-m-Y');

Into the config file seems to work. When I look at the properties of a page the date is in european format. Just need to test this with some add-ons etc.

This did not work for me in previous C5 versions but seems to in the latest. Nice one!
abstracts replied on at Permalink Reply
abstracts
Thanks for that!
ecomatt replied on at Permalink Reply
ecomatt
Have you tried this on any plugins yet? i cant get it working with extended form?

can you please help?
thanks
Mnkras replied on at Permalink Reply
Mnkras
you need to contact the extended for developer for that,
rickb replied on at Permalink Reply
rickb
This is a good suggestion but doesn't work in Blogga because it has hard-coded formats. I shall contact the Blogga developer with suggested patches to make it use the date formats as suggested above.

In the meantime, you need to edit

blogga/blocks/block_posts/view.php line 54
blogga/page_types/blogga_page.php line 41

and in both of them change the literal string 'F j, Y' to use the constant DATE_APP_GENERIC_MDY instead.

Rick
PassionForCreative replied on at Permalink Reply
PassionForCreative
Appears to be working fine with C5's own Calendar add on. Thanks guys.
oakleafg replied on at Permalink Reply
Hi, does anyone have a clue to why when I swap F d, Y to d F, Y to match the UK date format it wipes out already added news items in Pronews? Swap it back and the news reappears, asked the question on the Pronews support section but as yet have not heard back.

Thanks in advance.
MattWaters replied on at Permalink Reply
MattWaters
Hi oakleafg,

Off the top of my head, it seems like another part of the add-on must be relying on that date format to display events. Try searching for other references to the date format and see if you can easily alter what the broken part is asking for.

I've also reached out to the developer (ChadStrat) and asked him to check out your thread in Questions & Discussion. He's very active on the concrete5 forums, so I expect that you'll hear back from him soon.
TheRealSean replied on at Permalink Reply
TheRealSean
You can now use a Constant in you config/site.php

define('DATE_APP_DATE_PICKER','dd/mm/yy');
http://docs.jquery.com/UI/Datepicker/formatDate...