Last active
August 29, 2015 14:17
-
-
Save lmorillas/540a5fb4d817d8227a98 to your computer and use it in GitHub Desktop.
yearOf() Extract the year from an ISO date. Function for Simile - Exhibit
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
<script> | |
$(document).bind("scriptsLoaded.exhibit", function() { | |
Exhibit.FunctionUtilities.registerSimpleMappingFunction("yearOf", | |
function(d) { | |
return d.split('-')[0]; | |
}, | |
"number"); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment