RPE / RTC - Format Date variable for use in Native RTC Filter (6.0.6.1)
Hi,
I want to set a variable with the date + 2 weeks and store it in the format that can be used in a native filter in RPE/RTC.
The native filter requires a date format like below:
workitem/workItem[modified > 2010-12-07T10:10:53.000-0500]/(id|summary)
Which Javascript function will allow me to format my date this way without typing the date in manually?
I.e. I want to replace 2010-12-07T10:10:53.000-0500 with ${dateFilter}
Te below returns the wrong format...
var dateFilter = new Date(Date.now() + 12096e5); |
One answer
var dplus14 = new Date(Date.now() + 12096e5);
dateFilter = dplus14.getFullYear() + "-" + (dplus14.getMonth()+1).toString() + "-" + dplus14.getDate() + "T10:10:53.000-0500"
Can you check if this works?
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Not sure if that is of any help in your context, but you might want to look into https://jazz.net/wiki/bin/view/Main/AttributeCustomization#API_for_Javascript and search for the section Timestamp that is used in attribute customization to convert timestamps and dates. Maybe that gives you a hint to search.
E.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString or https://stackoverflow.com/questions/2573521/how-do-i-output-an-iso-8601-formatted-string-in-javascript