Skip to main content

Search

Calculate Dates

Comments

6 comments

  • Matthias Walter

    Hi Nicole Geier,

    you could use moment.js which is much easier and regardless of the culture.

    Reading JavaScript date values from SharePoint date fields regardless of locale (culture)

    https://momentjs.com/ 

     

    Kind regards

    Matthias

    0
  • Nicole Geier

    Hi Matthias,

     

    if I insert the Script von Adis I get this error:

     

    Should I insert the moment.js in the SiteAssets and change to var url="mySiteAssets"?

     

    Kind regards

    Nicole

    0
  • Nicole Geier

    Hi Matthias Walter,

     

    sorry I didn't mention you in my answer. I couldn't load the framework moment.js should upload it to the site collection?

     

    Kind regards

    Nicole

    0
  • Christof Nussbaumer

    Hi Nicole Geier

     

    Please check if you have connection to the moment library with the client by typing libraries browser address. If download of moment.js is shown you can load it as you did. If it's not available this way you have to provide it somewhere in your environment and link to this.

    0
  • Nicole Geier

    Hi Christof Nussbaumer

     

    I got the connection to this link as shown in your mail. I have also download the file into my SiteAssets

     

    but you see the functio moment isn't recognized. So I couldn't get a date out of it.

     

    Kind regards

    Nicole

    0
  • Christof Nussbaumer

    Hi Nicole Geier,

     

    'moment' is not defined in Expression Builder as it's not initialized same as in runtime. You can ignore this message in Expression Builder.

     

    Note the Function code expression type expect a return in the code block.

    May the Test without a selected item could be also an issue in your test.

     

    0

Please sign in to leave a comment.