Support » Plugin: Calculated Fields Form » Current date

  • Resolved selett

    (@selett)


    Hello,

    I would like to use the current day in a function.

    For example :
    (function(){if (fieldname11 – “current date” < 730){return cdate(fieldname10+1460);}else{return cdate(fieldname11+730);}})()

    How to do this ?

    Thanks for the help
    Best regards

    Selett

    http://wordpress.org/plugins/calculated-fields-form/

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hi Selett,

    This is the solution:

    (function(){
    var d = new Date();
    if (fieldname11 – d.valueOf()/86400000 < 730){
    return cdate(fieldname10+1460);
    }else{
    return cdate(fieldname11+730);
    }
    })();

    Thank you for using the plugin!

Viewing 1 replies (of 1 total)
  • The topic ‘Current date’ is closed to new replies.