Skip to content

Instantly share code, notes, and snippets.

@lordhx
Last active October 15, 2015 11:33
Show Gist options
  • Save lordhx/2d7d0caaaf4dc61d5f31 to your computer and use it in GitHub Desktop.
Save lordhx/2d7d0caaaf4dc61d5f31 to your computer and use it in GitHub Desktop.
gfHumanResourcesValue
angular.module('glassFactory').filter('gfHumanResourcesValue', function (currentProjectPlan, zoomLevel) {
function fUtil(val) {
console.log('fUtil', currentProjectPlan.settings.utilization, val)
switch (currentProjectPlan.settings.utilization) {
case 'perc':
return val + '%'
case 'mh':
return 8 * val / 100 + 'mh'
case 'md':
return val / 100 + 'md'
}
}
function fZoom(val) {
switch (zoomLevel) {
case 'day':
return val
case 'week':
return val * 5
case 'month':
return val * 25
}
}
return _.compose(fUtil, fZoom)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment