Index > Bug report > Error with date when saving news
As some background, I have set my "Date and time format" from System > System maintenance to be "F j, Y | g:i a". When I go to create a news article from Content > News > New article, I get the following error when clicking "Save".
I imagine this may have something to do with my somewhat modified date format. Maybe TypoLight isn't told to reverse format it to a more standarized style before storing it in the database.
Code:
Fatal error: Uncaught exception Exception with message Invalid date format F j, Y | g:i a thrown in /home/account_name/public_html/typolight/system/libraries/Date.php on line 187 #0 /home/account_name/public_html/typolight/system/libraries/Validator.php(212): Date::getRegexp('F j, Y - g:i a') #1 /home/account_name/public_html/typolight/system/modules/backend/DataContainer.php(435): Validator->execute('December 26, 20...', 'Date') #2 /home/account_name/public_html/typolight/system/drivers/DC_Table.php(1318): DataContainer->row() #3 /home/account_name/public_html/typolight/typolight/main.php(210): DC_Table->edit() #4 {main}
I imagine this may have something to do with my somewhat modified date format. Maybe TypoLight isn't told to reverse format it to a more standarized style before storing it in the database.
2006-12-27 00:24
hi ben,
is not a valid date format in typolight ... you can see some examples of valid date and time formats in the "Help Wizard" .... you can only use numeric date and time formats (j, d, m, n, y, Y, g, G, h, H, i, s) ...
F = a full textual representation of a month ( in the example for March )
i don't no why, but i think at the moment you can't use all date() formattings:
http://de3.php.net/manual/en/function.date.php
is not a valid date format in typolight ... you can see some examples of valid date and time formats in the "Help Wizard" .... you can only use numeric date and time formats (j, d, m, n, y, Y, g, G, h, H, i, s) ...
F = a full textual representation of a month ( in the example for March )
i don't no why, but i think at the moment you can't use all date() formattings:
Code:
date("F j, Y, g:i a"); for this result > March 10, 2001, 5:16 pm
http://de3.php.net/manual/en/function.date.php
Last edited by squidi, 2006-12-27 00:50
2006-12-27 00:41
Yeah ... the news section saves new articles properly now after I went with a simpler date / time format.
2006-12-27 08:56
Ben,
I don't know if you still care about this issue, but it seems that if you change the date format from within your news modules (as opposed to System Settings) you don't get the same error.
My change was simpler than yours (I wanted d-M-y) but I got an error when I tried to change the format globally from System Settings. When I changed it in my news module, it took without an error.
I don't know if you still care about this issue, but it seems that if you change the date format from within your news modules (as opposed to System Settings) you don't get the same error.
My change was simpler than yours (I wanted d-M-y) but I got an error when I tried to change the format globally from System Settings. When I changed it in my news module, it took without an error.
2007-04-16 05:35
Leo, would be great if the date formats for backend and frontend output could be separated somehow, e.g. backend working with numerical dates and Front end can output 'nice' full text months.
2008-05-16 15:08
Does anyone know whether any progress has been made on this issue?
I'm building a site with an events system which is going to be used primarily in the US and in France. Presenting the dates in a numeric format is going to be very confusing for our users, because of course Europe puts the day first and the US puts the month first. I really could do with a way to display the month textually.
Anyone got any new or suggestions?
I'm building a site with an events system which is going to be used primarily in the US and in France. Presenting the dates in a numeric format is going to be very confusing for our users, because of course Europe puts the day first and the US puts the month first. I really could do with a way to display the month textually.
Anyone got any new or suggestions?
2009-02-04 01:16
I'm answering my own question now, for anyone else who may have this problem.
It seems (she says tentatively, having only tested it a little) that as long as the central settings use an approved format, I can safely set each website root (I have two for different languages) to present a textual date format.
It doesn't translate the months, so it's not perfect, but it's still an improvement.
It seems (she says tentatively, having only tested it a little) that as long as the central settings use an approved format, I can safely set each website root (I have two for different languages) to present a textual date format.
It doesn't translate the months, so it's not perfect, but it's still an improvement.
2009-02-04 22:50
I've got the same problem, i tried this date format:
Normally the ouput should look like this:
I get:
I only get the problem if I insert a formular-module
After deinstalling the formcheck module, everything works fine
Code:
l, d. F Y
Normally the ouput should look like this:
Code:
Freitag, 1. Mai 2009
I get:
Code:
Fatal error: Uncaught exception Exception with message Invalid date format "l, d. F Y" thrown in /var/www/web42/html/bleibartig/system/libraries/Date.php on line 187 #0 /var/www/web42/html/bleibartig/system/modules/formcheck/FormCheck.php(200): Date->getRegexp('l, d. F Y') #1 /var/www/web42/html/bleibartig/system/modules/frontend/FrontendTemplate.php(125): FormCheck->outputTemplate('output() #3 /var/www/web42/html/bleibartig/index.php(187): PageRegular->generate(Object(DB_Mysql_Result)) #4 /var/www/web42/html/bleibartig/index.php(288): Index->run() #5 {main}
I only get the problem if I insert a formular-module
After deinstalling the formcheck module, everything works fine
Last edited by Nils Riel, 2009-05-01 18:16
2009-05-01 18:14
set on settings page
Date format: d.m.Y
Date and time format: l, d. M Y
Date format: d.m.Y
Date and time format: l, d. M Y
2009-05-02 23:02
That's no real solution in my case, I need the full month-name, not just a short one 
2009-05-04 19:12
Problem still remains. The error is also shown up after saving an catalog item.
l, d. M Y
l, d. M Y
Caution:
Fatal error: Uncaught exception Exception with message Invalid date format "l, d. M Y" thrown in /var/www/web42/html/bleibartig/system/libraries/Date.php on line 187
#0 /var/www/web42/html/bleibartig/system/libraries/Widget.php(558): Date->getRegexp('l, d. M Y')
#1 /var/www/web42/html/bleibartig/system/modules/backend/TextField.php(100): Widget->validator('Donnerstag, 25....')
#2 /var/www/web42/html/bleibartig/system/libraries/Widget.php(420): TextField->validator('Donnerstag, 25....')
#3 /var/www/web42/html/bleibartig/system/modules/backend/DataContainer.php(249): Widget->validate()
#4 /var/www/web42/html/bleibartig/system/drivers/DC_Table.php(1473): DataContainer->row()
#5 /var/www/web42/html/bleibartig/system/modules/backend/Backend.php(208): DC_Table->edit()
#6 /var/www/web42/html/bleibartig/typolight/main.php(99): Backend->getBackendModule('catalog')
#7 /var/www/web42/html/bleibartig/typolight/main.php(287): Main->run()
#8 {main}
Last edited by Nils Riel, 2009-05-06 12:13
2009-05-06 12:13
