Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

JoomlaTune Support Forum    JComments component    General discussion    Topic: How to change the date format ?
Pages: [1]   Go Down
  Print  
Author Topic: How to change the date format ?  (Read 32239 times)
0 Members and 1 Guest are viewing this topic.
7heo
Guest
« on: February 14, 2009, 18:17:16 »

Hello,

First, a huge thank you for your job you are awesome ! Wink

Jcomments is a perfect component which has only one problem for me, it doesn't really matter but, my website being in french, I would like to change the date format. Nowadays it's such as this format : Y-m-d H:i, i.e. english's format and I'd like it such as : d-m-Y H:i.

My question is, what file do I have to edit because I don't manage to find it.

Thank you for reading and helping.
And congratulation for your work.

Théo (sorry for my english, I'm french  Roll Eyes)
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #1 on: February 18, 2009, 02:46:37 »

At now you can edit template's file /components/com_jcomments/tpl/default/tpl_comment.php:

Code: (php)
<span class="comment-date"><?php echo JCommentsText::formatDate($comment->datetime'%Y-%m-%d %H:%M'); ?></span>
replace with:
Code: (php)
<span class="comment-date"><?php echo JCommentsText::formatDate($comment->datetime'%d-%m-%Y %H:%M'); ?></span>

In future version I'm plan move datetime format to language file...
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
7heo
Guest
« Reply #2 on: February 18, 2009, 21:25:09 »

It works ! Thank you smart  Cheesy

I think I have already seen the question about "à" on forum. Have you find a solution ?

Really good job and thanks again Wink
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #3 on: February 19, 2009, 01:07:39 »

I think I have already seen the question about "à" on forum.
No, can you show me this question?
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
7heo
Guest
« Reply #4 on: February 19, 2009, 02:41:32 »

I'm sorry I made a mistake, I saw this question on a french website speaking about your component.

I explain the problem :

"à" doesn't belong to english language so you cannot note this problem.

In fact, when somebody write a comment for instance :
"J'aime aller à Paris" which means in english "I like going to Paris"

Sentence doesn't appear totally, it is cut at the "à", i.e. we can read :
"J'aime aller"

French often use the "à" :s
Logged
TNZ
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #5 on: August 02, 2009, 22:01:19 »

Hello,

I'm French too (with fuc*** bad English, I'm sorry) and I'd like to change format date. I'm using Jcomments 2.0.0.19.

I edit template's file /components/com_jcomments/tpl/default/tpl_comment.php:

Code: (php)
<span class="comment-date"><?php echo date'Y-m-d H:i'$comment->datetime); ?></span>
replace with:
Code: (php)
<span class="comment-date"><?php echo date'd-m-Y H:i'$comment->datetime); ?></span>

It's working Smiley

But I'd like to have a format date like : "02 août 2009 à 18H00" (02 August 2009 at 6:00 pm).

Is it possible ? How can I do ?

Thanks in advance !!
Logged
TNZ
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #6 on: August 27, 2009, 16:04:35 »

But I'd like to have a format date like : "02 août 2009 à 18H00" (02 August 2009 at 6:00 pm).

Is it possible ? How can I do ?
==> Is it possible ?
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #7 on: August 27, 2009, 17:23:42 »

Since JComments 2.1 you can change date format in your JComments language file (fr-FR.com_jcomments.ini):

Code:
# date and time format
DATE_FORMAT=%d-%m-%Y
TIME_FORMAT=%H:%M
DATETIME_FORMAT=%d-%m-%Y %H:%M

See php.net/strftime for format description
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
TNZ
Newbie
*

Karma: 0
Offline Offline

Posts: 8


« Reply #8 on: August 27, 2009, 19:51:01 »

I updated from 2.0.0.9 to 2.1 and I changed in fr-FR.com_jcomments.ini and it's working. Perfect!
Thank you very much.
Logged
stevethi
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #9 on: January 11, 2010, 09:27:45 »

I can't seem to get dat change to work, altered the language file etc.

Currently I have this and I use English GB

#2 Adding YouTube as comment! — Administrator 2010-01-11 14:04

Want the format to be 10-01-2010 22:56

Am I missing something here, or has the latest version moved the format.

However in the Comments Module the date is fine.
Logged
smart
Administrator
Hero Member
*****

Karma: 187
Offline Offline

Gender: Male
Posts: 1883



WWW
« Reply #10 on: January 11, 2010, 18:28:03 »

I can't seem to get dat change to work, altered the language file etc.
Seems you've changed wrong file. You  need make changes in /language/en-GB/en-GB.com_jcomments.ini, not /components/com_jcomments/languages/en-GB.com_jcomments.ini (this file is temporary)
Logged

If you use JComments, please post a rating and a review at the Joomla! Extensions Directory
stevethi
Newbie
*

Karma: 0
Offline Offline

Posts: 2


Email
« Reply #11 on: January 12, 2010, 01:41:43 »

I can't seem to get dat change to work, altered the language file etc.
Seems you've changed wrong file. You  need make changes in /language/en-GB/en-GB.com_jcomments.ini, not /components/com_jcomments/languages/en-GB.com_jcomments.ini (this file is temporary)
Thank you, that fixed it, never thought to look there.
Logged
Pages: [1]   Go Up
  Print  
JoomlaTune Support Forum    JComments component    General discussion    Topic: How to change the date format ?
 
Jump to: