ambika created VELOCITY-956:
-------------------------------

             Summary: velocity 1.7 vs velocity 2.3: evaluation of scripts with 
empty value is not backward compatible
                 Key: VELOCITY-956
                 URL: https://issues.apache.org/jira/browse/VELOCITY-956
             Project: Velocity
          Issue Type: Bug
          Components: Engine, Scripting
    Affects Versions: 2.3
            Reporter: ambika
             Fix For: 2.3


{*}Script{*}:     

 

  "vLATE_GATE_IN_6":"#set( $inTimeZone = 
$date.getTimeZone().getTimeZone('Europe/Berlin') )\n\n#set( $outTimeZone = 
$date.getTimeZone().getTimeZone('Asia/Shanghai') )\n\n#set( $locale = 
$date.getLocale() )\n\n#set( $myDate = 
$convert.parseDate(${*}{lead.lateGateIn}{*},\"yyyy-MM-dd 
HH:mm\",$locale,$inTimeZone) )\n\n${date.format('yyyy-MM-dd hh:mm 
a',$myDate,$locale,$outTimeZone)} "

{*}note{*}: lead.lateGateIn = "" in the values 

there are multiple other scripts vLATE_GATE_IN_5, vLATE_GATE_IN_4 but in the 
script vLATE_GATE_IN_4 , the values for convert.parseDate is given as below:

$convert.parseDate("2022-04-22") 

 

{*}Issue{*}: 

Older version of velocity evaluates the script vLATE_GATE_IN_6 to: 
|Time):\\n\\n\\n\\n\\n2022-04-22 11:00 AM|

 

Newer version of velocity evaluates the script vLATE_GATE_IN_6 to: 
| |Time):\\n\\n\\n\\n\\n${date.format('yyyy-MM-dd hh:mm 
a',$myDate,$locale,$outTimeZone)}| |



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to