JSFiddle - React, Tailwind, and code Playground
by Ishank Dubey
JavaScript
var aArray = [
{
"rel": "causeComments",
"href": "http://10.177.66.59:8081/mes-service-impl-0.5.1-devlocal-SNAPSHOT/comment/v1/commentRecords/1183?tableId=DowntimeCause&tableKeyId=72398"
},
{
"rel": "addCauseComment",
"href": "http://10.177.66.59:8081/mes-service-impl-0.5.1-devlocal-SNAPSHOT/comment/v1/commentRecords?tableId=DowntimeCause&tableKeyId=72398"
},
{
"rel": "addActionComment",
"href": "http://10.177.66.59:8081/mes-service-impl-0.5.1-devlocal-SNAPSHOT/comment/v1/commentRecords?tableId=DowntimeAction&tableKeyId=72398"
},
{
"rel": "addResearchComment",
"href": "http://10.177.66.59:8081/mes-service-impl-0.5.1-devlocal-SNAPSHOT/comment/v1/commentRecords?tableId=DowntimeResearch&tableKeyId=72398"
}
];
var anObj = aArray.filter(function(anObj){
return anObj.rel.toUpperCase() == 'CAUSECOMMENTS'
});
console.log(anObj[0].href);
var aLocaleTimF = new Date("2017-03-07T00:23:06.983+0000");
alert(aLocaleTimF.toLocaleString());
var offSet = (new Date()).getTimezoneOffset();
var aZDate = new Date(aLocaleTimF.getTime()-offSet*60*1000);
alert(aZDate.getHours());
aZDate = aZDate.toLocaleString();
console.log(aZDate);