Expand my Community achievements bar.

SOLVED

Sightly Extension to format dates

Avatar

Level 2

With JSP/JSTL there is the tag <fmt:formatDate> to format dates according to the current locale. With Sightly there is currently not such an extension and also custom extensions are not supported (see questions at http://dev.day.com/content/ddc/en/gems/introduction-to-sightly/_jcr_content/par/download_0/file.res/...). What should we do to do date formatting properly. I don't want to do the formatting in my model class because that is clearly functionality belonging to the view.

1 Accepted Solution

Avatar

Correct answer by
Level 8

Can't you just create a reusable function in the Use API. You could create a JavaScript file or Java class and then pass in the data and the format String as parameters just as you would with <fmt:formatDate>. 

View solution in original post

1 Reply

Avatar

Correct answer by
Level 8

Can't you just create a reusable function in the Use API. You could create a JavaScript file or Java class and then pass in the data and the format String as parameters just as you would with <fmt:formatDate>.