Wrong week numbers in report with Gregorian calendar

Marie Elena
Tera Contributor

Hi,

I have a report where I want to see the week numbers instead of date. I found the week number by using the Gregorian calendar, only the calendar is showing the wrong week number in reports.

Looking at the Gregorian calendar configuration, the calendar start counting weeks from 1 January. It should start counting from 3 January. 1-2 January is week 52. This is the European standards. Example: Jan 31 – Feb 7 is week 5, not 6. 

Is there someone who has a solution for this or has created a calendar to use with European standards?

Thanks.

1 REPLY 1

betinajessen
Kilo Contributor

Try adding the Timezone offset first.   Or is there some fundamental 2023 calendar template difference between how both regions represent the weeks?



var gdt = new GlideDateTime();

 

gdt.add(gdt.getTZOffset());

 

gs.print(gdt.getWeekOfYearLocalTime());