• Resolved eabonie

    (@eabonie)


    I’m trying to get the result of a calculated field and display that inside my post.

    The result will be a cdate.

    I would like to know how to change the cdate formate from dd/mm/yyyy to text, eg 21 September 2016.

    Also how can I then insert this result into a block of text in the editor.

    eg. this is some example text that will display the date as <cdate result here> for my users to see as just part of the post and not a special field.

    Thanks

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

    (@codepeople)

    Hello,

    For example if your post includes a <DIV> tag with a class name (<div class="result"></div>), and the current equation is:

    cdate(fieldname1,'dd/mm/yyyy')

    You should edit it as follows:

    (function(){
    var r = (new Date(fieldname1*86400000)).toDateString();
    jQuery('.result').html(r);
    return r;
    })()

    and that’s all.
    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Display the calculated field results in post text’ is closed to new replies.