1
0
-1

Hi,

I'm trying to do some date calculations using a JavaScript library in a form.

When the calculations are performed the console shows an error that says that t.toISOString is not a function.

However, if I enter the appropriate code in the browser console it performs without error and returns the correct output.

e.g. new Date().toISOString().slice(0,10) returns the current date as "2018-09-26" as expected.


Can I use JavaScript functions in my code, or do I have to do date/string manipulation manually to get the date returned in the format "yyyy-mm-dd"?


Thanks

Mark

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      You should be able to use momentjs for calculation and date formatting

      1. Mark Murray

        Hi Yulius,

        thanks for the suggestion; that worked.

        I didn't realise that momentjs was accessible in my custom JavaScript library, but that is very helpful.


        Thanks

        Mark

      CommentAdd your comment...