Skip to content

Instantly share code, notes, and snippets.

@lmorillas
Last active August 29, 2015 14:17
Show Gist options
  • Save lmorillas/540a5fb4d817d8227a98 to your computer and use it in GitHub Desktop.
Save lmorillas/540a5fb4d817d8227a98 to your computer and use it in GitHub Desktop.
yearOf() Extract the year from an ISO date. Function for Simile - Exhibit
<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