How to display week number in devExtreme date-box for angular?

1.6k Views Asked by At

I'm making an angular component that shows a calendar. The date format should be "Week 29, 2019-07-19". Also, I want to know how to customize the display Text - maybe using the template?

1

There are 1 best solutions below

1
Dmitry Levkovsky On BEST ANSWER

DateBox have the displayFormat option which allows you to change the formatting of the displayed value.

You can use the Globalize library that support "week of the year" formatting. The template will look like this: <dx-date-box displayFormat="'week' ww, dd/MM/YYYY"></dx-date-box>

You can also use custom format by defining the functions "formatter" and "parser"