Jump to content

Show week number in the date picker calender display


alfr

Recommended Posts

Hi, 

We use week numbers a lot. Our users/clients use them in the dialog with their customers.

How can the uniDateTimePicker and unidbDateTimePicker be reconfigured to also show the week number (iso8601 week number) on the left side when the monthly calender is shown?

Left - date picker calendar unigui - right other example from Outlook - with the week numbers marked with yellow.

image.png.24cb8557b910387ee5a56fa7688af544.png     image.png.6048647879c9bf568d97adac37724589.png

Below sample js script for calculating the week number.

Would appreciate if someone with good knowledge in UniGui how to reconfigure the calender...

function ISO8601_week_no(dt) 
  {
     var tdt = new Date(dt.valueOf());
     var dayn = (dt.getDay() + 6) % 7;
     tdt.setDate(tdt.getDate() - dayn + 3);
     var firstThursday = tdt.valueOf();
     tdt.setMonth(0, 1);
     if (tdt.getDay() !== 4) 
       {
      tdt.setMonth(0, 1 + ((4 - tdt.getDay()) + 7) % 7);
        }
     return 1 + Math.ceil((firstThursday - tdt) / 604800000);
    }

Link to comment
Share on other sites

On 9/15/2019 at 10:34 PM, alfr said:

How can the uniDateTimePicker and unidbDateTimePicker be reconfigured to also show the week number (iso8601 week number) on the left side when the monthly calender is shown?

Hi,

At the moment it looks something like this:

datetimepickerwithweeknumbers.png.e87c69beb03af636ff7939885e5d3bf7.png

Link to comment
Share on other sites

15 minutes ago, alfr said:

Ok. So will it be available in a future version or something that I can implement by your instructions and code? (I'm currently using version 1.70.0.1489)

I hope that maybe this will be available in future versions.

Well, if I can complete this in some working state, I will post the solution here too.

20 minutes ago, alfr said:

I'm currently using version 1.70.0.1489

Ok. I think it's better to upgrade to the latest version :)

Link to comment
Share on other sites

×
×
  • Create New...