Count Number of Days

SI Function: 

daysToDueDate: function(incident) {

        var totalDuration;

        var now = new GlideDateTime().getLocalDate();

     if (!incident.dueDate.nil()) {

            var dueDate = new GlideDateTime(incident.duedate).getDate();

            totalDuration = new GlideDateTime.subtract(now, dueDate);

            var numberofDays = parseInt(totalDuration.getNumericValue() / 86400000);

            }

    return nubmerOfDays;

},

            

            

            

Comments

Popular posts from this blog

Background Scripts

Glide Record Cheat Sheet

Setup OAuth2 authentication for RESTMessageV2 integrations