By Adam O. on Thursday, 27 August 2015
Replies 4
Likes 0
Views 0.9K
Votes 0
Hi there,

I've got a question about date format and date language changing in composer view.

At now is 27 Aug, 2015 14:53, but I will:

- change date format (delete decimal after Aug)

- change date language (not Aug, but month in my native language)

in which file (in code) can I change this?

I'll be very gratefull for your help!
Best regards!
Adam
Hey Adam,

The format of the date can be defined in the language string below:

COM_EASYBLOG_MOMENTJS_DATE_DMY24H="Do MMM, YYYY HH:mm"

As for the locale of the date, it seems like this isn't being translated by PHP but rather on datetimepicker's end and this actually relies on the language files on js. What is the locale that you are currently running on? You could modify the file /components/com_easyblog/themes/wireframe/composer/form/publish_date.js and locate the codes below,


format: "<?php echo JText::_('COM_EASYBLOG_MOMENTJS_DATE_DMY24H'); ?>",


And change it to,


format: "<?php echo JText::_('COM_EASYBLOG_MOMENTJS_DATE_DMY24H'); ?>",
language: "fr"


Can you give this a try?
·
Friday, 28 August 2015 01:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Mark,

I tired your solution and it causes some problems - it load three leters of month correct, but number of days with 'th' -> 7th instead of simple 7

and more over it loads incorrect hour -> my UTC is GMT +2h, but it looks like it loads + 4 hours

so can you please help me to solve this thread with other solution?


Best regards!
Adam
·
Tuesday, 08 September 2015 00:04
·
0 Likes
·
0 Votes
·
0 Comments
·
and moreover changing by adding language: "pl" in consequence ignoring settings in language file - I add or delete comma form date format, and nothing happen in composer view (no matter in en-GB or pl-PL)
·
Tuesday, 08 September 2015 00:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi Adam,

The language in the datetimepicker is different from your Joomla language setting. The language file will be load based on your Joomla language

I tired your solution and it causes some problems - it load three leters of month correct, but number of days with 'th' -> 7th instead of simple 7


Regarding the above, try to use:


COM_EASYBLOG_MOMENTJS_DATE_DMY24H="DD MMM, YYYY HH:mm"


Basically you are replacing the 'Do' to 'DD'. If you would like your day to display 1 instead of 01, then use 'D' instead of 'DD'

For the datetime format, you can take a look at this documentation http://momentjs.com/docs/

As for the timezone issue, is your Joomla user's timezone configured correctly? Since this is a javascript datetime picker, you might want to check if your PC timezone configured correctly or not

Hope this help and have a nice day!
Sam
·
Friday, 11 September 2015 16:56
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post