Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 04:21:51 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Calender V1.0RC6: How to re-order the date & time?  (Read 768 times)
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« on: March 25, 2008, 04:36:20 PM »

Hi,

How can I change the order of the date & time in the Calendar module?

Now the output is like this:


Date & Time:  2008-04-10 22:00 
End:                2008-04-11 03:00


In our region (Netherlands) the output would be: 10-04-2008 22:00

How can I re-order this? I checked several files, did some tweaking, checked the forum, but no luck.

Hope for help or an answer  smiley
Logged

...:: Bake the Unbakable ::...
marathoner

Offline Offline

Posts: 495


« Reply #1 on: March 26, 2008, 03:11:21 AM »

I don't use this module so this is a guess...but most modules use the view.php file to create the displayed HTML. I would guess that if you look in the file you will see where to change the date formating.
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #2 on: March 26, 2008, 10:33:36 AM »

Hi Marathoner,

Yes, you are correct, I checked this file too, but unfortenately no luck either. Sad
Logged

...:: Bake the Unbakable ::...
doc
Guest
« Reply #3 on: March 26, 2008, 12:06:10 PM »

Hello,

unfortunatelly the calendar module stores hardcoded strings like: YYYY-MM-DD instead of a timestamp. The latter one would allow to style the output in any way you like by the PHP function date.

A short fix for your problem is to extract month, date and year by the PHP function substr and to output the result in the order you want. Have a look to the file: /modules/calendar/functions.php.

Around line 240 search for
Code:
echo $tmp['date_start'];
and replace it with
Code:
echo substr($tmp['date_start'],8,2) .'.' .substr($tmp['date_start'],5,2) .'.' .substr($tmp['date_start'],0,4);

Around line 256 search for
Code:
echo $tmp['date_end']." ";
and replace it with
Code:
echo substr($tmp['date_end'],8,2) .'.' .substr($tmp['date_end'],5,2) .'.' .substr($tmp['date_end'],0,4) .' ';

This allows you to style the output to whatever you need.

Regards Christian
Logged
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #4 on: March 30, 2008, 11:21:11 AM »

Hello Christian,

Thank you for taking the time to give your explanation and solution. It works Smiley
Logged

...:: Bake the Unbakable ::...
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!