Is there a date format function which converts Unix timestamp(for eg. 1474344000) to human readable. Thanks in advance.
Ended up using native js function
function convertTimeStamp(timestamp)
{
var d = new Date(timestamp * 1000);
var yyyy = d.getFullYear();
var mm = (‘0’ + (d.getMonth() + 1)).slice(-2);
var dd = (‘0’ + d.getDate()).slice(-2);
time = mm + ‘/’ + dd + ‘/’ + yyyy;
}
scheme:{
$init:function(obj) {
obj[“effective_date”] = convertTimeStamp(obj[“effective_date”]);
obj[“published”] = convertTimeStamp(obj[“published”]);
}
}
If there are any better solutions please let me know
Thanks,
Webix allows formatting date objects only. But once you’ve converted Unix timestamp into the date object, you can apply any formatting method to it:
obj.date = webix.i18n.parseFormatStr(new Date(obj.date));
Please, check: http://webix.com/snippet/e95a2153
That helps. Thank you