Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Format Date Value REST SharePoint

$
0
0

Hi

I was wandering if anybody could help me with converting this date format(2016-05-04T00:00:00Z) to 04-May - 1.00.

Not sure where to start from. I know I can get it to this  '04-05' but its how to  make it '04-May' and then add the time. That's where I'm stuck. Any help would be much appreciated. thanks

$.ajax({
             url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('"+CalendarListName+"')/items?$Select=Title,Location,

EventDate, ID",
            type: "GET",
            headers: { "ACCEPT": "application/json;odata=verbose" },
            success: function (data) {


		var DateValue;




		 for (i=0; i< data.d.results.length; i++) {

			//format Date value
			console.log(data.d.results[i].EventDate);
			DateValue = data.d.results[i].EventDate;
			DateValue = DateValue.split('T');
			DateValue = DateValue[0].split('-');
			//DateValue = DateValue[2] + "-" + DateValue[1];
                       //DateValue = date.parse(data.d.results[i].EventDate);

			console.log(DateValue);

                  }


Viewing all articles
Browse latest Browse all 7589

Trending Articles



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