Displaying week numbers in date picker

Contains tips for configurators working with Aware IM
Post Reply
joben
Posts: 245
Joined: Wed Nov 06, 2019 9:49 pm
Location: Sweden
Contact:

Displaying week numbers in date picker

Post by joben »

This might be a Swedish thing since our way of talking about work-related stuff, vacations, etc, is very much focused around week numbers.
However, I just figured out how to include week numbers in the date picker which was a feature request by an end user who does a lot of planning work:
Skärmbild 2021-04-16 093034.png
Skärmbild 2021-04-16 093034.png (19.9 KiB) Viewed 28248 times
Just add this as a script when configuring the timestamp attribute inside a form:

Code: Select all

config.config.weekNumber = true;
Add some CSS if you like:

Code: Select all

/*date picker display week number*/
.k-calendar .k-content .k-alt{
	font-weight:bold; 
	font-size:10px;
}
It seems to work really well with the Swedish way of counting week numbers (yes, there are different ways to do it around the world). Maybe the locale culture settings fixes this automatically.
Regards, Joakim

Image
hpl123
Posts: 2641
Joined: Fri Feb 01, 2013 1:13 pm
Location: Scandinavia

Re: Displaying week numbers in date picker

Post by hpl123 »

Very nice :D
Henrik (V8 Developer Ed. - Windows)
Post Reply