Dates in Velocity Scripting - Anomalous Behavior
Hi Everyone,
Hope your week has started well.
I just came across a situation where the below script is running into error for a specific date but it is fine for other dates.
Example: When the leadcapturedate i.e. my object is having value '2021-09-03' or value = '2022-05-21' it is working fine, but when the object had value -'2022-05-29', it failed.
2. Also, may I know if this is the right way to display date in single digit in my code below in line #3 .for example date is 2021-09-03 then it is displaying 3 September 2021, which is what I want. But just wanted to confirm.
**** Code****
#set($myCal = $convert.toCalendar(${convert.parseDate(${lead.as_leadcapturedate},'yyyy-MM-dd')}))
#set($calConst = $field.in($myCal))
#set($FRIENDLY_24H_DATETIME_WITH_FRIENDLY_TZ ='d MMMM yyyy')
$myCal.add($calConst.DATE,30)
${date.format($FRIENDLY_24H_DATETIME_WITH_FRIENDLY_TZ,$myCal)}
Any inputs in this regard will be appreciated.
Kind Regards,
Vidhi