Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 141307

Convert values in array to date objects jquery

$
0
0

I have array I'm getting from calling a .net controller.

I'm getting these values for dates:

/Date(1445256000000)/ and /Date(1445256900000)/

Instead of that I want to be able to get proper date values.

Now since I have array of objects I want to be able to update them in the array before sending them to the view.

This is what I have:

$http({
            method: 'GET',
            url: '/Driver/GetDriverTrips',
            params: { id: id }
        }).
        success(function (data) {
            var startDate= new Date(data[0].StartTime.match(/\d+/)[0] * 1);
            alert(myDate);

        });

So this conversion works properly but the thing is that I want to loop through all the same objects in the array, do the conversion and then again save it in the array.

Is there any function I can do that?


Viewing all articles
Browse latest Browse all 141307

Trending Articles



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