194
rated 0 times
[
198]
[
4]
/ answers: 1 / hits: 28874
/ 9 Years ago, mon, august 3, 2015, 12:00:00
I am formatting a Date, with not momentjs or any other library, just pure JS. And I want to know if there is a way to simplify this with ES6
let currentDate = new Date();
const videosInformation = {
time: currentDate.getHours() + ':' + currentDate.getMinutes(),
date: (currentDate.getMonth() + 1) + '/' + currentDate.getDate() + '/' + currentDate.getFullYear(),
gameId: Math.floor((Math.random() * 5000) + 1)
};
I saw that in the DOM you use something like renderSomething={`something: ${someObj}`}
so you don't have to do renderSomething={something: + {someObj}}
is there something I should use to do that kind of format?
More From » date