• getAgo

    By Steve Macca 1 decade ago

    I had to put my code back in to get it to work.

     

    var today:NotesDateTime = session.createDateTime(datetime);
            //var ndt2:NotesDateTime = session.createDateTime(datetime);
            today.setNow();
            var created:NotesDateTime = currentDocument.getDocument().getCreated();
            var diff = today.timeDifference(created).toFixed(0);
                    
            //var v = "ndt1 = " + ndt1.getLocalTime() + " ndt2 = " + ndt2.getLocalTime();
            //var dt3 = ndt2.timeDifference(ndt1);

            var min = parseInt(diff/60,0);

    • what

      By Thomas Adrian 1 decade ago

      are you saying that 1.4 is not working for you?

      is the code you submitted to this post the working one?

      • only part code used

        By Steve Macca 1 decade ago

        Looking at 1.4 I can see part code I changed used. Ill put the code below just so it s together in the response. If you view the code below, the commented out code is the old code that has gone through from 1.3 to 1.4. The uncommented code is the code that works for me and is not in 1.4. "var min = parseInt(diff/60,0);" is changed from var min = parseInt(dt3/60,0);

        =====code works for me

        var today:NotesDateTime = session.createDateTime(datetime);
         
        today.setNow();
        var created:NotesDateTime = currentDocument.getDocument().getCreated();
        var diff = today.timeDifference(created).toFixed(0);
        var min = parseInt(diff/60,0);

        ====== Old code does not work for me
        //var ndt2:NotesDateTime = session.createDateTime(datetime);

        //var v = "ndt1 = " + ndt1.getLocalTime() + " ndt2 = " + ndt2.getLocalTime();
        //var dt3 = ndt2.timeDifference(ndt1);
         //var min = parseInt(dt3/60,0);

        • yes

          By Thomas Adrian 1 decade ago

          That seem to work for me as well, I have added it to next release

           

          Thanks
          /Thomas