Last active
April 24, 2019 10:33
-
-
Save nsdevaraj/9824ea1a10290834b131c096475aea09 to your computer and use it in GitHub Desktop.
copy json from zoho
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output={}; | |
temp1.forEach(function(objs,index){ | |
var i = index; | |
var outputDays={}; | |
for (var key in temp1[i]) { | |
// skip loop if the property is from prototype | |
if (!temp1[i].hasOwnProperty(key)) continue; | |
var obj = temp1[i][key]; | |
if(obj['dayStatus'] == 'P'){ | |
var otdt=obj.hrsStatus.split('/')[1]; | |
if(otdt) otdt.indexOf('DT')!=-1? obj.dt=otdt.split('(')[0] : obj.ot=otdt.split('(')[0]; | |
delete obj.dayStatus; | |
delete obj.hrsStatus; | |
obj.name = objs.name; | |
outputDays[parseInt(key)+1] = obj | |
} | |
} | |
output[i] = outputDays; | |
}) | |
copy(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
temp1 = temp1.concat(temp2)
outputDays['Apr-'+(parseInt(key)+1)] = obj