WordPress.org

Ready to get started?Download WordPress

Forums

Calculated Fields Form
[resolved] Current date (2 posts)

  1. selett
    Member
    Posted 10 months ago #

    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/

  2. codepeople
    Member
    Plugin Author

    Posted 10 months ago #

    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!

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.