I have a table listing the dates field that are in 2015-08-27T22:38:21.0Z
format. I managed to convert them into August 27th 2015, 3:38:21
using the moment()
http://momentjs.com/. now i need to apply this changed format into my table.
html:
<table id="table">
<thead>
<tr>
<th>Date</th>
<th>Address</th>
<th>Details</th>
</tr>
</thead>
<tbody>
<tr>
<td class="date-time-format">
<time datetime="{{updatedDate}}">{{updatedDate}}</time>
</td>
<td>
{{address}}
</td>
<td>
{{details}}
</td>
</tr>
</tbody>
</table>
here is the js:
$.each(data, function(time, format){
var timeformat = format.date;
moment(timeformat).format('MMMM Do YYYY, h:mm:ss');
});
Now how do i pass this:timeformat
value into every td
to return something like:
Date
September 13th 2015, 1:09:12
August 13th 2015, 1:09:12
October 13th 2015, 1:09:12
November 13th 2015, 1:09:12
fiddle:http://jsfiddle.net/hw6wvrgL/
Any help is greatly appreciated.Thanks!!!