Vedachalam Mahadevan
03/13/2025, 6:52 AMCeligo AI
03/13/2025, 6:52 AMAI generated answer (using internal Slack threads):The issue with the date not rendering in the FreeMarker template could be due to the incorrect usage of the date formatting function. In FreeMarker, the
?string
function is used to format dates, numbers, and other data types. The correct syntax to format a date is ${date?string("yyyy/MM/dd")}
.
In your case, you are using >${date?string("yyyy/MM/dd")}
which is incorrect. The >
character is not needed.
Also, to add a year to the date, you can use the ?time
built-in function in FreeMarker. This function returns the date/time value as a number of milliseconds since the epoch. You can then add the number of milliseconds in a year to this value and convert it back to a date. Here is an example:
${(date?time + 31536000000)?number_to_date?string("yyyy/MM/dd")}
In this example, 31536000000
is the number of milliseconds in a year (60 seconds * 60 minutes * 24 hours * 365 days * 1000 milliseconds).
Please try to correct your template as follows:
hi,
Pls click: <b><i><a href='<<https://4146758.app.netsuite.com/app/site/hosting/scriptlet.nl?script=167&deploy=1&hidReportStartDate=${date?string(%22yyyy/MM/dd%22)}&hidReportEndDate=${(date?time|https://4146758.app.netsuite.com/app/site/hosting/scriptlet.nl?script=167&deploy=1&hidReportStartDate=${date?string("yyyy/MM/dd")}&hidReportEndDate=${(date?time> + 31536000000)?number_to_date?string("yyyy/MM/dd")}'>* View Report *</a></b></i> to view ‘Time Off Requests for Next 1 Rolling Year’.
Thanks.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
03/13/2025, 6:52 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.826865852
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.823383331
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.821479082
Celigo AI
03/13/2025, 6:52 AM