Support » Plugin: Add to Google Calendar for Contact Form 7 » Date does not work properly

  • Hi and thanks for this great plugin,
    it worked fine in tests I made but now it does not show the right date, but it takes today instead.
    I have version I have (1.5)
    where can I download the latest version ( you wrote here that there is a version 2)
    maybe that will solve the problem
    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter Michalooki

    (@michalooki)

    Hi,
    the problem is that when the link is generated ,
    it creates a day after the date that was entered.
    like this:

    dates=20200610/20200611

    it works fine when the day in the date is 10 and up.
    but it does not work with 1-9

    the second date is written in one digit instead of 2
    like this:

    dates=20200608/2020069
    and than it does not recognize the date

    It is something to fix in the js:

    var oneMoreDay = function( date ){
    date = new Date ( date );
    date.setDate( date.getDate() + 1 );
    return formatDate( date );
    };

    //just numbers
    date1 = date1.replace(/\D/g,”);

    if( date2 != 0 ){
    date2 = date2.replace(/\D/g,”);
    } else{
    date2 = oneMoreDay( date1 );
    date2 = date2.replace(/\D/g,”);
    }

    dates = ‘dates=’ + date1 + ‘/’ + date2;

    How can taht be solved?

    Thanks
    Michal

Viewing 1 replies (of 1 total)
  • The topic ‘Date does not work properly’ is closed to new replies.