It's all about the answers!

Ask a question

RPE / RTC - Format Date variable for use in Native RTC Filter (6.0.6.1)


Glyn Costello (1404554) | asked Mar 29 '22, 10:06 a.m.
edited Mar 29 '22, 10:11 a.m.
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);
dateFilter;


Comments
Ralph Schoon commented Mar 29 '22, 10:33 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.  


One answer



permanent link
Subramanya Prasad Pilar (4.6k16) | answered Mar 29 '22, 2:21 p.m.
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


Register or to post 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.