Forum Replies Created

Viewing 1 replies (of 1 total)
  • I have several functions in a file called functions.js and I would like to execute them from MaxButtons. Does the free or upgraded version support this? I have a snippet of the code below I would like to call.

    function popup() {
    alert(“Hello World”)
    }

    // ***************************************************************************************

    function BetweenDates() {
    var date1 = document.DateDiff.StartDate.value
    var date2 = document.DateDiff.StopDate.value
    var IncludeLastDay = document.DateDiff.IncludeLastDay.checked
    date1 = date1.split(“-“);
    date2 = date2.split(“-“);
    var sDate = new Date(date1[0]+”/”+date1[1]+”/”+date1[2]);
    var eDate = new Date(date2[0]+”/”+date2[1]+”/”+date2[2]);
    var daysApart = Math.abs(Math.round((sDate-eDate)/86400000));
    if (IncludeLastDay == true)
    daysApart = daysApart + 1
    var weeksApart = daysApart / 7
    var LeftoverDays = daysApart % 7
    document.DateDiff.TotalDays.value = daysApart
    document.DateDiff.TotalWeeks.value = Math.floor(weeksApart)
    document.DateDiff.LeftoverDays.value = LeftoverDays
    }

Viewing 1 replies (of 1 total)