New lower pricing for Subscriptions

50%off old price

Add rota results in rota_date 1970-01-01

About Support Rota Add rota results in rota_date 1970-01-01

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2550
    Avatar for mkirchhoefermkirchhoefer
    Member

    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

    #3320
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    It 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

    #3321
    Avatar for mkirchhoefermkirchhoefer
    Member

    Hi,

    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-01

    Thenks
    Martin

    #3322
    Avatar for Andy MoyleAndy Moyle
    Keymaster

    So 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.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.