Shortening test in Podio calculated table

Comments

1 comment

  • Rainer Grabowski

    Between for() and lines.push() put this var:
    var apptrefShort = apptref1[i] != null ? apptref1[i].substr(0,9) : "";
    Then in lines.push() use that var instead of apptref[i].

    Btw: The sorting can be done much easier (and preserves Podio Server resources a bit): 
    Under var apptrefShort add
    var dateYMD = "{{" + moment(apptdate[i]).format("YYYYMMDD") + "}}"
    Add the var in lines.push() just at the beginning: 
    lines.push(dateYMD + moment(apptdate[i]).format("DD-MM-YYYY") + " | " + appttype[i] + " | " + formatappt[i] + " | " + apptattend[i] + " | " + apptrefShort)
    var lines = lines.sort() 
    or .sort().reverse()
    At the end: lines.join("\n").replace(/{{.*?}}/g,"")

    Rainer



    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk