object - Using lodash/underscore how can I update the value of the key -


i have convert date timestamp using date.parse().each time find key "date__c".

[    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    } ]  become   [    {       "date__c":1438185600000,       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":1438185600000,       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":1438185600000,       "end_time__c":"14:00",       "start_time__c":"07:00"    } ] 

arr = [    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    },    {       "date__c":"07/30/2015",       "end_time__c":"14:00",       "start_time__c":"07:00"    } ]  _.map(arr,      function (a) {          return _.mapvalues(a, function(v, k) {                  return "date__c" == k ? new date(v).valueof() : v;              }         )     } ) 

Comments

Popular posts from this blog

Upgrade php version of xampp not success -

amazon web services - S3 and apache mod_proxy with basic authentication -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -