Hi,
Does SuteCRM have an option to show week numbers in a calendars (calendar itself, date picker)? I could not find a setting to enable this.
Hi,
Does SuteCRM have an option to show week numbers in a calendars (calendar itself, date picker)? I could not find a setting to enable this.
No, it doesnāt.
This depends on the underlying Calendar impementation which is FullCalendar, which does have an option for this (although I have no idea what exactly it does).
As you can in our code see this option is always hard-coded to false:
https://github.com/salesagility/SuiteCRM/search?p=1&q=weekNumbers&unscoped_q=weekNumbers
A quick non-upgrade-safe fix would be to uncomment this line here and then run Admin / Repairs / Rebuild JS.
You can also ask this kind user who recently had a very similar question to yours, to make that option configurable at the same time that he works on his own change and contributes it to core:
Hi,
Thanks for the tip regarding the jssource/src_files/modules/Calendar/Cal.js. Changing this added weeknumbers to the calendar module, but not to the smal calendar in the datepicker when scheduling calls etc. I think it is this file: include/SugarFields/Fields/Datetime/SugarFieldDatetime.php
Whatās though strange is that the weeknumbers shown are wrong in jssource/src_files/modules/Calendar/Cal.js . Eg. the current week today is shown as W48, even if it should be W5. So Week 1 starts according to this calendar on Monday 2nd of March 2020ā¦
That is quite weird, yes. Only thing that I can think of is that this is a FullCalendar bug. Maybe you can find some reference to it if you search their project. We are not using their newest version (nowhere near that, I fear)
Ahaaā¦ Got it. They had a bug in 2015 which did show the weeknumberw wrong
Here is also an attached screenshot of the problem
In their demo though the weeknumbers work correctly:
https://fullcalendar.io/docs/weekNumbers-demo
Is the fullcalendar also used in the datepicker that is used in the other modules eg when adding meetings?
Figured this outā¦ We need to add āweekNumberCalculation: āISOā,ā to the config-section of the calendar where āweekNumbers: trueā, then the week numbers show correct!
So part of my case is now solved. Next would be to get the weeknumber to the datepickerā¦
I canāt look into this right now, but if you check the rendered HTML on the datepicker you can probably figure out if it0s also coming from FullCalendar or not, or find it in our source code so we can check how itās generatedā¦
I made a PR to allow adjusting week numbers from the Settings UI
Wow, great! Thanks!
Note that these settingsā defaults can also be overridden system-wide in config_override.php
. Users can still adjust their own preferences after that. Examples:
$sugar_config['calendar']['event_limit'] = 3;
$sugar_config['calendar']['show_week_numbers'] = 1;