-
-
Save kbaribeau/3784044 to your computer and use it in GitHub Desktop.
accessing functions??
This file contains hidden or 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
var cycleTimeFunctionThatNeedsABetterName = function(acceptedDate, inProgressDate) { | |
var cycleTime = Math.round(Ext.Date.getElapsed(acceptedDate,inProgressDate) / 1000 / 60 / 60 / 24); | |
if (cycleTime === 0) cycleTime = 1; | |
return cycleTime; | |
}; | |
Ext.define('CustomApp', { | |
extend: 'Rally.app.App', | |
componentCls: 'app', | |
launch: function() { | |
var id; | |
var inProgressDate; | |
var acceptedDate; | |
var cycleTime; | |
var kanbanState; | |
Ext.create('Rally.data.WsapiDataStore', { | |
model: 'User Story', | |
autoLoad: true, | |
limit: Infinity, | |
listeners: { | |
load: function(store, data, success) { | |
Ext.Array.each(data, function(story) { | |
kanbanState = story.get('KanbanState'); | |
if (kanbanState === 'Accepted') { | |
id = story.get('FormattedID'); | |
inProgressDate = story.get('InProgressDate'); | |
acceptedDate = story.get('AcceptedDate'); | |
cycleTime = calculateCycleTime(acceptedDate, inProgressDate); | |
console.log('ID: ' + id + ' cycleTime: ' + cycleTime); | |
} | |
}); | |
} | |
} | |
}); | |
}, | |
calculcateCycleTime: cycleTimeFunctionThatNeedsABetterName | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment