ATF : Set date and time as dynamic field value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2025 10:38 PM - edited 01-16-2025 11:37 PM
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?
Thanks,
Tiasha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-20-2025 02:55 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 02:42 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 07:19 AM
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:
Sets the value like below: