Created
July 24, 2014 14:13
-
-
Save OnkelTem/7e6684f3e862e1485d9f to your computer and use it in GitHub Desktop.
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
function preRender(data) { | |
_.each(data, function (el, key) { | |
if (_.isObject(el) && el.date_type == 'datetime') { | |
var date = []; | |
date[0] = moment(el.value + ' ' + el.timezone_db, 'YYYY-MM-DD H:m:s z', lang); | |
date[1] = moment(el.value2 + ' ' + el.timezone_db, 'YYYY-MM-DD H:m:s z', lang); | |
el = date; | |
} | |
else if (_.isObject(el)) { | |
el = preRender(el); | |
} | |
data[key] = el; | |
}); | |
return data; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment