1770 Posts in 495 Topics by 531 members
Blog Module
SilverStripe Forums » Blog Module » Invalid Time Format
Discuss the Blog Module.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1597 Views |
-
Invalid Time Format

8 July 2010 at 1:58pm
I just installed 2.4 with the blog module (fresh download of both on July 5) and ran into some issues when I went to change the blog's entry date. When I select a date using the date picker, it shows up in dd/mm/yyyy format and fails validation (expects mm/dd/yyyy).
I looked in the forums and found Mo's entry from about a month ago. It talked about adding the locale setting and used en_NZ, so I figured I'd try setting it to en_NZ (locale setting already existed and was the default en_US, which would be my locale, anyway), but it didn't help. It also mentioned a bug report, which I followed and found a revised version of the DatetimeField file. I downloaded the latest copy of the file and replaced my copy of the file, but it didn't work, either (though it did give me a slightly more useful error than the generic "Javascript error"), AND it triggered a somewhat interesting behavior - with the new code in DatetimeField and nothing else, when I opened the date picker, it defaulted to Sept 7, 2011 (I have no clue where it got that date from).
Has anyone found a way to fix or get around the main issue (wrong date format)? I think it might be minor for me at this point, since I shouldn't be backdating anymore entries, but it'd be nice to be able to use the date picker tool to select the date that I want and have it validate properly on the occasions that I would be selecting a new date. Also, it might help others who are also having trouble and the solutions in the other thread aren't working.
-
Re: Invalid Time Format

16 July 2010 at 8:00am Last edited: 16 July 2010 8:02am
Bump.
I have the same issue.
I use the date picker and choose, say...May 8, 2010. (05/08/2010)
After saving the page the date shows as August 5, 2010. (08/05/2010)
Any thoughts?
C.b
EDIT: Or how to disable the date-picker tool?
-
Re: Invalid Time Format

29 July 2010 at 9:15am
I think this needs a bug report filed? Or documentation?
Chris.b
-
Re: Invalid Time Format

3 August 2010 at 6:20am
I've filed a bug report for it. It can be found here: http://open.silverstripe.org/ticket/5900
-
Re: Invalid Time Format

24 November 2010 at 10:01am
I added the following line to BlogEntry.php under line 86 and works fine:
$dateField->getDateField()->setConfig('dateformat', 'dd/MM/YYYY');
Now looks like:
$fields->addFieldToTab("Root.Content.Main", $dateField = new DatetimeField("Date", _t("BlogEntry.DT", "Date")),"Content");
$dateField->getDateField()->setConfig('showcalendar', true);
$dateField->getTimeField()->setConfig('showdropdown', true);
$dateField->getDateField()->setConfig('dateformat', 'dd/MM/YYYY'); -
Re: Invalid Time Format

4 January 2011 at 1:47am Last edited: 4 January 2011 1:55am
Hi everybody ! Happy new year !
IHMO this is a critical bug : if you download the module, you just CAN'T create any blog entry.
Module is supposed to be maintain by silverstripe, so why this very easy to fix bug is still here ?
I tried to go to the ticket but no way to load any ticket from the bug tracker since last saturday. (edit : ok manage to go to http://open.silverstripe.org/ticket/5900 but no answers since 5 monthes...? )How can we fix it ? where to provide the patch, how can we make this commited quickly ? Which is the process in silverstripe community ?
Thanks
-
Re: Invalid Time Format

4 January 2011 at 2:04am Last edited: 4 January 2011 2:05am
forgot to say that RichMcNabb's patch solve the issue for me
-
Re: Invalid Time Format

4 January 2011 at 7:52am
And also a happy new year to all! Had the same problem some time ago.
I solved it by installing the locales (dutch in my case) on my webserver.ubuntu:
apt-get install language-pack-nl-basedebian (lenny):
apt-get install debconf
dpkg-reconfigure localesIn Silverstripe i use the following for placing the datefields. Don't know how this is done in the blog module...
$date_field = new DateField('ArticleDate', 'Article date');
$date_field->setConfig('showcalendar', true);
$date_field->setConfig('showdropdown', true);
$date_field->setConfig('dateformat', 'dd-MM-YYYY');
$fields->addFieldToTab('Root.Content.Main', $date_field, 'Content');And in _config.php
setlocale(LC_TIME, i18n::get_locale() . '.utf8');
hope this will help.
| 1597 Views | ||
|
Page:
1
|
Go to Top |





