Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-749

Expose DateFormatSymbols through the Velocity $datetool

    XMLWordPrintable

Details

    Description

      This is useful for a Date Picker widget that needs to display and format proper month and day names depending on the context locale.

      {{velocity}}
      #set ($currentLocale = $services.localization.currentLocale)
      #set ($dateFormatSymbols = $datetool.getDateFormatSymbols($currentLocale))
      $jsontool.serialize($dateFormatSymbols.shortMonths)
      {{/velocity}}
      
      ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
      

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: