Last active
October 15, 2015 11:33
-
-
Save lordhx/2d7d0caaaf4dc61d5f31 to your computer and use it in GitHub Desktop.
gfHumanResourcesValue
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
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