您可以尝试在最近90天内按StarDate筛选的代码。请查看控制台中的输出:
Ext.define('CustomApp', { extend: 'Rally.app.App', componentCls: 'app',
launch: function() {
this.loadIterations();
},
loadIterations: function() {
var millisecondsInDay = 86400000;
var currentDate = new Date();
var startDate = new Date(currentDate - millisecondsInDay*90);
var startDateUTC = startDate.toISOString();
console.log('startDateUTC',startDateUTC);
console.log('startDate',startDate);
var iterations = Ext.create('Rally.data.WsapiDataStore', {
model: 'Iteration',
autoLoad: true,
fetch: ['ObjectID', 'Name', 'StartDate', 'PlannedVelocity'],
filters:[
{
property: 'StartDate',
operator: '>=',
value: startDateUTC
}
],
sorters: [
{property: 'StartDate', direction: 'ASC'}
],
listeners: {
load: function(store, data, success) {
Ext.Array.each(data, function(record) {
console.info('ID: ', record.get('ObjectID'),
' Name: ', record.get('Name'),
' StartDate: ', record.get('StartDate'),
' PlannedVelocity: ', record.get('PlannedVelocity'));
});
}, scope: this
}
});
}
});