Quantcast
Channel: Microsoft Online: SharePoint Online forum
Viewing all articles
Browse latest Browse all 10096

Date Only field one day off when updating a SharePoint List Item using EcmaScript

$
0
0

Hi ,

I have written a function using ECMASCRIPT to update a date only field with today's date (for SharePoint Online Portal)

Though the date value in variable is correct, when the item is created, it displays the date of previous day.

I also tried to convert the date based on site's regional settings but then 'undefined' error is thrown by the code.

var context = new SP.ClientContext.get_current();
var web = context.get_web();
var dateToUpdate = new Date(myDate);
var newDate = web.get_regionalSettings().get_timeZone().localTimeToUTC(dateToUpdate.toISOString());

Can someone help me to figure this out ?

Thanks,

Nutan


Nutan Sharma


Viewing all articles
Browse latest Browse all 10096

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>