Jump to content
uniGUI Discussion Forums
alfr

Show week number in the date picker calender display

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);
    }

Share this post


Link to post
Share on other sites
11 hours ago, 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,

Need to investigate.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Great! The week Numbers are there so really everything we need. :rolleyes:  Thanks for investigating! Is it complicated to implement?

Share this post


Link to post
Share on other sites
8 hours ago, alfr said:

Is it complicated to implement?

Need to override some methods and add some methods and properties, and take into account themes.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
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 :)

Share this post


Link to post
Share on other sites

×