ATF : Set date and time as dynamic field value

tiasha123
Tera Contributor

Hi ,

I want to set the planned start and end date along with time as the field value in ATF. How do I do that ? 

 

For Example: 

for Planned start date and time , I used = javascript: gs.nowDateTime().split(' ')[0].concat(' ', '00:00:00');

Planned end date, I used =  javascript: gs.endOfThisYear().split(' ')[0].concat(' ', '00:00:00');

 

But it is not setting the values. How to achieve this?

 

tiasha123_0-1737099416620.png

 

 

Thanks,

Tiasha

7 REPLIES 7

Hi @Shaqeel ,

 

Thanks for your response . I want to set the time as well with the date. How do we do that ? Could you please help me with javascript function for ,"planned startdate" will be the " current date" and "planned end date" will be end of the year date.

Hi @tiasha123 

 

Add the following to the above format .split(' ')[0].concat(' ', 'HH:MM:SS');

For tomorrow at 1am time example: javascript: gs.daysAgo(-1).split(' ')[0].concat(' ', '01:00:00');

 

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

Hi @tiasha123 ,

The solution provided by Shaqeel works.

Also, for setting Year end date, below script can be used.

javascript:new Date(new Date().getFullYear() X, 11, 31, 23, 59, 59).toISOString().split('T').join(' ').slice(0, 19);

 

Replace the X with any Number.

For Past Year:  +1, +2, +3......

For Current Year: +0

For Future Year: -1, -2, -3......

 

Example: 

Chidanand_VK_1-1737472553378.png

Sets the value like below:

Chidanand_VK_3-1737472609569.png

 

If my answer helped you in any way, please mark it as helpful or correct.
 
Regards,
Chidanand Kalmani