17452 Posts in 4473 Topics by 1971 members
|Go to End|
2 December 2007 at 1:55am Last edited: 2 December 2007 2:23am
I was checking the blog module and basing part of what I'm building on the code of it, while I discovered this pretty nasty bug:
In the backend cms, the calendardatefield switches day and month, and so the calendar popup also gives the wrong date: today would be 12 februari instead of 2 december.
I can't imagine nobody has seen this yet? It might be possible it only does this in the last month?
I'll open a ticket for this....
2 December 2007 at 2:09am
Ok what I've found was mostly interesting:
This in the populateDefaults() method on blogentry
$this->Date = date("d/m/Y H:i:s",time());
makes the date switched. (even though it is in d/m/Y here?! )
Leaving it out, just gives a blank field in the cms.
But putting this in the populateDefaults thing
$this->Date = date("H:i:s",time());
(so without the d/m/Y) gives the correct date....
2 December 2007 at 2:13am
$this->Date = date("Y-m-d H:i:s",time());
in the populateDefaults method
also gives the correct date...
Core Development Team
2 December 2007 at 10:09am
Hi Dieter - it would be great if your able to submit a patch for this
2 December 2007 at 10:14am Last edited: 2 December 2007 10:16am
Well, I guess the patch would just be by replacing the / with - in the populateDefaults method in blogentry.php.
Like in $this->Date = date("Y-m-d H:i:s",time());
But maybe the one who made the blogmodule can provide more insight to why / was used and why with - it still displays as /
I'm not to keen on submitting a patch without actually being sure I tackled the real cause of it. , I'm not a professional programmer you know
2 December 2007 at 11:11am
Andy and Jeremy were the ones who originally made the blog module. Perhaps they can provide some insight.
14 January 2008 at 3:17pm Last edited: 14 January 2008 3:23pm
Thanks for finding this dio5!
I assume this bug is produced when you create a new blogentry page from the CMS...correct?
Doing this didn't give me a switched date, but definitely showed the wrong date.
If that wasn't the way you produced the bug, let us know. For the mean time I've made the date-format change to "Y-m-d H:i:s".
14 January 2008 at 10:05pm Last edited: 15 January 2008 6:20am
Yep, it was from in the cms. I tried this on the demosite too, and it had the same 'switched' result.
Now I just tried it again on the demo-site, and it set the date to 01/01/1970, so something has changed, but it still does weird.
|Go to Top|