Page 1 of 1

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 12.08.2011, 12:03
by some person
I have looked into this and have added it. Open settings_system.tpl found in templates\standard\, and find <option value = "m/d/y">m/d/y</option> below that add the following.
Code: Select all
               <option value = "Y.m.d">Y.m.d</option>
               <option value = "Y-m-d">Y-m-d</option>

Copy both, or only one line, depending on what format(s) you need.

Now there is a problem with the date picker (calendar), so you will need to go here (viewtopic.php?p=13128#p13128) to get the updated calendar. Save the js file and replace the original with it, which is found in include\js\ dyrectory. Now this doesn't fix all the problems. I still see the problem where, if the date is selected in any other month then the current selected month, then the date format reverts to d.m.y.

I haven't looked into this much, so I am not sure if I can properly fix this. But you can actually hard code the date format, in the calendar. You can do this by editing mycalendar.js, and changing this.dateFormat = "d.m.Y" to dateFormat = "Y-m-d" or whatever other format you want to use. The proper fix would be to modify the code so that, if you change the date format, the calendar changes.

Also I noticed that the date format, in activity log, does not change, so this needs to be fixed.

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 15.09.2011, 19:28
by Philipp
Collabtive 0.7.5 will include a much improved php date() compatibility in the datepicker.
This should fix all the bugs that currently plague date formatting. And it will allow to format date formatting more flexible than before.

Collabtive 0.7.5 is about to be released in 1-2 weeks. Most of it is already available in the google SVN .. but this is not recommended for production u se.

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 28.11.2011, 23:54
by georkame
My coworker found the fix just

change the format in class.mylog.php (line 220), function formatdate

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 25.04.2015, 21:37
by smile
Installed latest 2.11 and still there is no way to use Y.m.d date? Hello am I missing something. I tried the fix but collabtive started to throw errors like

Code: Select all
Warning: date() expects parameter 2 to be long, string given in /include/class.milestone.php on line 251

Warning: date() expects parameter 2 to be long, string given in include/class.milestone.php on line 255


I changed all "d.m.Y" to "Y.m.d", but seriously date fix should need a user to modify half of the files and still not work.

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 27.04.2015, 13:14
by ChristianF
Hello,

This thread is 4(!) years old, any fix above is severely outdated. I recommend replacing all the files you edited with the default ones, before doing anything else.
I can have a look at this for you, but I can't guarantee when I'll have the time for it.

Re: Change date format to Y.m.d or Y-m-d

PostPosted: 01.05.2015, 22:06
by Eva
This thread is 4(!) years old, any fix above is severely outdated. I recommend replacing all the files you edited with the default ones, before doing anything else.

1000x this!