Skip to content

Instantly share code, notes, and snippets.

@nhajratw
Created September 25, 2012 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save nhajratw/3783890 to your computer and use it in GitHub Desktop.
Save nhajratw/3783890 to your computer and use it in GitHub Desktop.
accessing functions??
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