Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
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....
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....
$this->Date = date("Y-m-d H:i:s",time());
in the populateDefaults method
also gives the correct date...
Hi Dieter - it would be great if your able to submit a patch for this :-)
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 :-)
Andy and Jeremy were the ones who originally made the blog module. Perhaps they can provide some insight.
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".
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. :)