Created
September 25, 2012 19:23
-
-
Save nhajratw/3783890 to your computer and use it in GitHub Desktop.
accessing functions??
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
Ext.define('CustomApp', { | |
extend: 'Rally.app.App', | |
componentCls: 'app', | |
launch: function() { | |
var calculateCycleTime: function(acceptedDate, inProgressDate) { | |
var cycleTime = Math.round(Ext.Date.getElapsed(acceptedDate,inProgressDate) / 1000 / 60 / 60 / 24); | |
if (cycleTime === 0) cycleTime = 1; | |
return cycleTime; | |
} | |
Ext.create('Rally.data.WsapiDataStore', { | |
model: 'User Story', | |
autoLoad: true, | |
limit: Infinity, | |
listeners: { | |
load: function(store, data, success) { | |
Ext.Array.each(data, function(story) { | |
var id; | |
var inProgressDate; | |
var acceptedDate; | |
var cycleTime; | |
var kanbanState; | |
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); | |
} | |
}); | |
} | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment