Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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);
dateFilter;

0 votes

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.  



One answer

Permanent link
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?

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,927
× 152
× 19
× 6

Question asked: Mar 29 '22, 10:06 a.m.

Question was seen: 1,656 times

Last updated: Mar 29 '22, 2:21 p.m.

Confirmation Cancel Confirm