I'm working in SharePoint 2013 using REST API to retrieve Date field values. I need to get the from now value of those fields and so I am using JS Moment, but so far I can't the moment code to work at all. Here's some snippets of my SharePoint REST API code:
url:/sites/regulatory3/testdashboard/_api/web/lists/GetByTitle('Contacts')/items?"$Select=Created,OData__x0031_st_x0020_Draft_x0020_Test",
$.each(data.d.results, function (key, value) {
var createdDate1 = $.format.date(value.Created, 'dd/MM/yyyy');
var createdDate2 = createdDate1.toString();
var createdDate3 = new Date(createdDate2);
var firstDueDate1 = $.format.date(value.OData__x0031_st_x0020_Draft_x0020_Test, 'd MMM yyyy');
var firstDueDate2 = firstDueDate1.toString();
var firstDueDate3 = new Date(firstDueDate2);
Any help on this ?