• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Solved]How to change date format
PostPosted: Fri May 18, 2012 6:19 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
Using 1.10.3

In some modules such as CGCalendar, I can change the date format in the templates.

How do I change it for FEU? I have the format %d%m%Y in Global Settings. I want this in FEU for User Created date and Expiry date. At present it is showing dates as %Y%m%d.

Thanks


Last edited by jasnick on Thu Jun 07, 2012 12:03 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Mon May 21, 2012 6:44 pm 
Offline
Beta Tester
Beta Tester
User avatar

Joined: Tue Nov 21, 2006 5:05 pm
Posts: 249
Location: Nashville, USA
Use the modifier, "cms_date_format" or "date_format"

For example,
Code:
{$userinfo.expires|cms_date_format:"%d/%m/%Y"}


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Mon May 21, 2012 10:51 pm 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
OK - thanks very much!


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Fri Jun 01, 2012 7:37 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
Are you talking about this line from the View User Template?

<p>{$feu->Lang('expires')}:&nbsp;{$userinfo.expires}</p>

I changed it to

<p>{$feu->Lang('expires')}:&nbsp;{$userinfo.expires|cms_date_format:"%d/%m/%Y"}</p>
and without the cms, but neither worked.

What is the correct format for the date? I have seen the d m y separated by colons, slashes and commas.


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Fri Jun 01, 2012 12:44 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
Maybe my post in this thread helps? viewtopic.php?f=13&t=61272

It's in Dutch, but the code is multilingual ;)

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Sat Jun 02, 2012 12:40 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
Thank Jos - I see now that whatever is used in the date_format, such as slashes or hyphens, is what apears in the finished product, so to speak.

So that %d-%m-%Y would appear as 1-6-2012.

My problem remains: how to get this into FEU for the User list.
This is what I have:
Attachment:
feu.png
feu.png [ 3.97 KiB | Viewed 1427 times ]


and this in the View User Template
<p>{$feu->Lang('expires')}:&nbsp;{$userinfo.expires|date_format:"%d-%m-%Y"}</p>

Thanks


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Sun Jun 03, 2012 9:17 pm 
Offline
Power Poster
Power Poster

Joined: Wed Aug 13, 2008 10:57 am
Posts: 554
Hi,

what Jos told you is to try this:

{'d-m-Y'|date:$userinfo.expires}

instead of

{$userinfo.expires|date_format:"%d-%m-%Y"}

As it worked for me I guess it will work for you.

Kind regards,
Jan


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Mon Jun 04, 2012 12:05 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
Thanks janvl - but it didn't work for me unfortunately.

We are talking about the View User Template - I assume that is the one? I wonder if there is somewhere else it has to be changed as well? This is so frustrating - on the surface, it seems like such a simple thing to be able to change.

I have also read about 'locale' being set in the config. Is this essential? I just have the local time zone set.


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Mon Jun 04, 2012 6:38 pm 
Offline
Power Poster
Power Poster

Joined: Wed Aug 13, 2008 10:57 am
Posts: 554
Could you tell exactly what you did/made?
Where you put smartytags to get the list you want, what parameters you use etc. etc.

Maybe I can rebuild it and see where things do not work.

Kind regards,
Jan


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 7:24 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
Thanks janvi

I haven't done anything really to the default FEU and default SR modules. I set the preferences and am more or less using it "out-of-the-box".

Am using the View User Template altered as mentioned earlier in this thread: I imagine this controls what I see when I click on Users as illustrated in the image I posted earlier showing how the Created and Expires dates are rendered.

{* view user template *}
<p>{$feu->Lang('id')}:&nbsp;{$userinfo.id}</p>
<p>{$feu->Lang('username')}:&nbsp;{$userinfo.username}</p>
<p>{$feu->Lang('email')}:&nbsp;<a href="mailto:{$email_address}">{$email_address}</p>
<p>{$feu->Lang('expires')}:&nbsp;{'%d-%m-%Y'|date:$userinfo.expires}</p>
{foreach from=$user_properties item='entry'}
{if $entry.type != 0}
<p>{$entry.prompt}:&nbsp;{$entry.data}</p>
{/if}
{/foreach}

In the config file I have:

$config['locale'] = 'en_AU.utf8';
$config['timezone'] = 'Australia/West';

and in Global Settings I have English set and %d-%m-%Y.

and in User Prefs I have %x%X - have also tried %d-%m-%Y in there as well but made no difference.

There does not seem to be anywhere in SR and FEU to manage the date format - at least in the Admin area. I can't believe everyone uses the American date format.

Does this mean I need to change certain files in the /modules/FEU files?

Thanks


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 10:42 am 
Offline
Power Poster
Power Poster

Joined: Wed Aug 13, 2008 10:57 am
Posts: 554
Hi,

as far as I can see, you mix up the backend and the frontend.

With changing a template, you change something you can use in the frontend, not the backend.

If you want the way the date is presented, changed in the backend, contact Robert Campbell. Maybe he can help.

I wish you good luck.

Kind regards,
Jan van Leeuwen


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 11:32 am 
Offline
Power Poster
Power Poster

Joined: Sat Jan 15, 2011 8:36 am
Posts: 540
Location: Western Australia
You're probably right, Jan - I'm not very technical.
Thank you very much for taking the time to look at my issue - I do appreciate it.


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 1:17 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
janvl wrote:
If you want the way the date is presented, changed in the backend, contact Robert Campbell.

You can change module backend templates yourself. You don't need the developer to do that.

I searched for a forumtopic or an article in the wiki that explains how, but could only find this example for the news module:
http://blog.arvixe.com/backend-preview- ... ws-module/
read step 2 and step 3

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 3:02 pm 
Offline
Power Poster
Power Poster

Joined: Wed Aug 13, 2008 10:57 am
Posts: 554
Thanks Jos,
interresting link!

You would need
in modules/FrontEndUsers/templates
userlist.tpl
line 122, 123, 124

be carefull, save the original!

Good luck,
Jan


Top
 Profile  
 
 Post subject: Re: How to change date format
PostPosted: Tue Jun 05, 2012 3:05 pm 
Offline
Power Poster
Power Poster
User avatar

Joined: Wed Sep 05, 2007 8:03 pm
Posts: 3653
Location: The Netherlands
The point is that you don't change an existing template, but first copy it to the module_custom/yourmodule/ directory and make the changes on the copied one. Else you would lose your changes with the first upgrade you do.

_________________
Get nice guestbook messages from your site visitors with the brand new Gbook module.
Integrate Piwik Web Analytics in your site admin with the Piwik module.
Extend your global site settings with the Custom Global Settings module.
The Fourth Dutch CMS Made Simple Workshop on April 9 2011 was great fun! Read all about it here
Announcement: The Fifth Dutch CMS Made Simple Workshop coming up?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: mountcn


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner