You missed the new before Date(date) Also, maybe try multiplying that value by 100
<Feed.Date>{new Date(date*100)}</Feed.Date>
I think that you can use the format function to help you with this.
Date.prototype.format = function(format)
{
var o = {
"M+" : this.getMonth()+1, //month
"d+" : this.getDate(), //day
"h+" : this.getHours(), //hour
"m+" : this.getMinutes(), //minute
"s+" : this.getSeconds(), //second
"q+" : Math.floor((this.getMonth()+3)/3), //quarter
"S" : this.getMilliseconds() //millisecond
}
if(/(y+)/.test(format)) format=format.replace(RegExp.$1,
(this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)if(new RegExp("("+ k +")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length==1 ? o[k] :
("00"+ o[k]).substr((""+ o[k]).length));
return format;
}
Try adjusting your code like so:
<Feed.Date>{ new Date(date) }</Feed.Date>
By creating a date object (via new
), you can simplify conversion from UTC epoch time (ie the value of date
) into a human readable date string.
For more information on Date, see this MDN article
I'm struggling with ui-router configuration which will define basic CRUD in the application. I need to be able to add, remove, edit and search for, say, clients. Quite basic task. Main page with ...
I'm struggling with ui-router configuration which will define basic CRUD in the application. I need to be able to add, remove, edit and search for, say, clients. Quite basic task. Main page with ...
I am a student and very new to JS, like this is my first project dealing with it. With that being said, please excuse how juvenile my coding may seem to you experts. I followed the instructions of my ...
I am a student and very new to JS, like this is my first project dealing with it. With that being said, please excuse how juvenile my coding may seem to you experts. I followed the instructions of my ...
I'm trying to iterate over a simple array using recursion. For this specific case, I'm trying to recreate .map() using recursion (without using .map()!. I currently am only pushing the last element ...
I'm trying to iterate over a simple array using recursion. For this specific case, I'm trying to recreate .map() using recursion (without using .map()!. I currently am only pushing the last element ...
Consider a matrix B= [[6,4,1,2], [5,3,9,7],[1,3,2,1]];. B is a matrix with three rows and four columns. I want to treat it as an array or a vector, namely B1=[6,4,1,2,5,3,9,7,1,3,2,1]. Moreover, I ...
Consider a matrix B= [[6,4,1,2], [5,3,9,7],[1,3,2,1]];. B is a matrix with three rows and four columns. I want to treat it as an array or a vector, namely B1=[6,4,1,2,5,3,9,7,1,3,2,1]. Moreover, I ...