So, I tried to retrieve my "UTC" timezone setting from my Rally project using the Javascript SDK2 WSAPI:
function loadWorkspace() {
Ext.create('Rally.data.WsapiDataStore', {
model: 'Workspace',
context: {
workspace: gvRallyWorkspace,
project: gvRallyProject,
projectScopeUp: false,
projectScopeDown: false
},
autoLoad: true,
listeners: {
scope: this,
load: function (store, records, successful) {
if (successful) {
loadedWorkspace(store, records);
} else {
console.log('There was a problem finding values for workspaces.');
}
}
}
});
}
function loadedWorkspace(store, wksp) {
console.log(wksp);
}
The query works well and I get the attributes of the workspace set in query context... But I can see nothing in the workspace object that defines the UTC timezone offset. The Notes attributes seems to hold some configuration but no timezone settings:
Does someone know how to retrieve the Rally workspace UTC offset value from SDK2?
Original Message:
Sent: 01-23-2020 05:41 PM
From: Gregory Garcia
Subject: Lookback API vs WSAPI - Date comparison
In case in can help someone else, here is how I managed to convert yesterday date (2020-01-22 at 23h59) to the Samoa timezone date. Then I convert it to ISO string format so that it can be used with LookbackAPI queries.
The method uses the Luxon library to easily manage the timezone change:
Original Message:
Sent: 01-22-2020 09:21 AM
From: Gregory Garcia
Subject: Lookback API vs WSAPI - Date comparison
Hi Nik!
Thanks for your help!
I confirm what you suppose: the workspace seems to be configured on Samoa timezone whereas I'm on Paris timezone:
Original Message:
Sent: 01-22-2020 04:01 AM
From: Nik Antonelli
Subject: Lookback API vs WSAPI - Date comparison
Hi Greg,
Can you have a look at what timezone your workspace is set to? You can either ask your subadmin to tell you, or alternatively, it comes up in the Portfolio Items view if you have the Planned End Date shown, e.g:
The 13 hours different makes me think you are in a workspace set to Alaska time even though you are in Finland, Latvia or somewhere in Eastern Europe.
------------------------------
Nik
Ask me a question, I'm All Ears!
Rally Sales Engineer
Rally Software
Original Message:
Sent: 01-21-2020 06:07 PM
From: Gregory Garcia
Subject: Lookback API vs WSAPI - Date comparison
Hello,
For a given feature, I try to compare a date attribute (planned start date and planned end date) between now (WSAPI) and yesterday (Lookback API). Just to clear any doubt: the date values did not change in the meanwhile, I expect to have the same values :)
Here is what I get with the LookBack API:
planned start date = 2018-10-22T00:00:00.000Zplanned end date = 2019-03-22T23:59:59.000Z
Here is what I get with the WSAPI:
planned start date = Mon Oct 22 2018 13:00:00 GMT+0200 (Central European Summer Time)planned end date = Sat Mar 23 2019 11:59:59 GMT+0100 (Central European Standard Time)
In order to compare the dates, I try to have the same type of object and date format. I convert the ISO format from Lookback API to the Rally format using Rally.util.DateTime.fromIsoString(myFeature.PlannedStartDate) and here is what I get:
planned start date = Mon Oct 22 2018 02:00:00 GMT+0200 (Central European Summer Time)planned end date = Sat Mar 23 2019 00:59:59 GMT+0100 (Central European Standard Time)
In the end, my dates are not comparable: the year/month/day/minutes/seconds/timezone are matching but not the hours.
Have I missed something in Lookback API dates management?
Thanks for your inputs,
Greg.