Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-13580

org.apache.velocity.tools.generic.DateTool.toDate(...) used in templates doesn't work as expected

    Details

      Description

      Hi, I have used following Velocity template in Liferay 5.1.2 and it prints expected results (returns Date) bud if I try the same in 6.0.5 many of them (with BAD) returns null.
      I'm really not sure what's going on...

        1. Velocity template BEGIN
          $dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss Z" , "Fri, 24 Sep 2010 10:53:00 +0200") BAD<br/>
          $dateTool.toDate("dd MMM yyyy hh:mm:ss Z" , "24 Sep 2010 10:53:00 +0200") BAD<br/>
          $dateTool.toDate("MMM yyyy hh:mm:ss Z" , "Sep 2010 10:53:00 +0200") BAD<br/>
          $dateTool.toDate("yyyy hh:mm:ss Z" , " 2010 10:53:00 +0200") OK<br/>
          $dateTool.toDate("hh:mm:ss Z" , "10:53:00 +0200") OK<br/>
          $dateTool.toDate("dd MM yyyy hh:mm:ss Z" , "05 11 2010 10:53:00 +0200") OK<br/>
          $dateTool.toDate("EEE dd MM yyyy hh:mm:ss Z" , "Fri 05 11 2010 10:53:00 +0200") BAD<br/>
          $dateTool.toDate("EEE, dd MMM yyyy hh:mm:ss" , "Fri, 24 Sep 2010 10:53:00") BAD<br/>
        2. Velocity template END

        Attachments

          Activity

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since last comment:
                5 years, 45 weeks, 3 days ago