Maintenance is complete- We've moved from the saas.hpe.com domain to softwaregrp.com click to read more
As part of our journey to complete our separation work and our future integration with Micro Focus, we've now updated our domain for the community. This is an interim step, which will be followed by a series of future update / improvements: - Piloting Idea boards - Refreshing the entire UI. (more to come later) - and more
Service Manager / Service Center Practitioners Forum
cancel

SM 9.4 - is it possible to create a rule to set a date to 30 days beyond today?

SOLVED
Go to solution
Jeff Lawrence
Super Contributor.

SM 9.4 - is it possible to create a rule to set a date to 30 days beyond today?

is it possible to create a rule to set a date to 30 days beyond the current date/time?

I tried the following code that did not work:  

value=date(tod())+'30 00:00:00'"

2 REPLIES
Highlighted
AFranke
Micro Focus Expert
Solution

Re: SM 9.4 - is it possible to create a rule to set a date to 30 days beyond today?

Well, there are these two different date types:

System Language date/time

- to call System language function from JS, you'll need to use it like this: system.functions.tod(),

and

JavaScript Date.

 

In Javascript, there are following constructors for Date object:

var d = new Date();    // returns now
var d = new Date(milliseconds);
var d = new Date(dateString);
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);

So you can do this:

var f = new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30);

 

Jeff Lawrence
Super Contributor.

Re: SM 9.4 - is it possible to create a rule to set a date to 30 days beyond today?

that worked - we used a set field using using javascript and used

value =  new Date(new Date().getTime() + 1000 * 60 * 60 * 24 * 30);

BOOOOOM!! Thanks!