- This topic is empty.
-
AuthorPosts
-
18th September 2013 at 10:15 am #2550mkirchhoeferMember
Hi,
when adding a rota this results in a rota_date of 1970-01-01 (which will be never displayed)
(I’m running with “define(‘WPLANG’, ‘de_DE’);”)With some debuggig I’ve found:
church-adminincludesrota.php: #263 rota_date: 20 Okt 2013
church-adminincludesrota.php: #269 date: 1970-01-01
church-adminincludesrota.php: #280: SELECT rota_id FROM wp_church_admin_rotas WHERE rota_date=”1970-01-01″AND service_id=”1″church-adminincludesrota.php: #297: INSERT INTO wp_church_admin_rotas (rota_jobs,rota_date,service_id)VALUES(“a:6:{i:1;s:6:”a:0:{}”;i:2;s:6:”a:0:{}”;i:3;s:6:”a:0:{}”;i:4;s:6:”a:0:{}”;i:5;s:6:”a:0:{}”;i:6;s:6:”a:0:{}”;}”,”1970-01-01″,”1″)
church-adminincludesrota.php: #317
the following line creates a string which is not “re-translated” correctly with strtotime:
if(!empty($next_date)) echo ‘ value=”‘.mysql2date(“d M Y”,$next_date).'” ‘;
(next_date: 2013-10-06 mysql2date= 06 Okt 2013)It looks as if within church-adminincludesrota.php: line #263
$date=date(‘Y-m-d’,strtotime($_POST));If the string in the form is modified from “Okt” to “Oct” everything works fine
==> looks like an internationization issue
Thanks
Martin
18th September 2013 at 10:48 am #3320Andy MoyleKeymasterIt sure is an internationalisation issue.
Your WordPress is set up for German, but your server isn’t by the looks of things. So the strtotime function only recognised English input.I need to look into it more, but a quick Google suggests that
Code:setlocale(LC_TIME, WPLANG);in wp-config.php may fix it or even in the plugin index file!
Do you want to try it and come back to me please? If it works I will put it in the plugin as it should then work globally for all users
18th September 2013 at 11:39 am #3321mkirchhoeferMemberHi,
added the line into the plugin index.php ==> same result
attached is a simple test script – the output is:
line #10: Indate: 20 Okt 2013, strtotime (): , date: 1970-01-01Thenks
Martin18th September 2013 at 12:32 pm #3322Andy MoyleKeymasterSo we have discovered strtotime can’t be localised and also googled checked php.net to confirm!
I’ll force the date picker to output YYYY-MM-DD and adjust the labels to specify date should be YYYY-MM-DD – it’ll be in next update as I’ll need to fix the directory, rota and possibly calendar too. -
AuthorPosts
- You must be logged in to reply to this topic.