77
Views
7
Comments
[Extended DateTime] Wrong start of week
extended-datetime
Service icon
Forge asset by Matthias Preuter
Application Type
Traditional Web

Hi guys,

So I think I may have found a bug in the component.

If I use the action WeekNumber with the dates 2020-12-28 and 2021-01-04, with the default values, I will get the respective week number 53 and 1. This is correct!

Now if I use the StartOfWeek action with default values (they are the same) for week 53 2020 and 1 2021, I get the start of week 2020-12-28, correct, but I get 2021-01-11 for week 1 2021, wrong! the start of week for 1 2021 should be 2021-01-04.


2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Mikael,

I checked the component and is giving the correct week , there is one parameter week rule , if you pass the week rule value as 1 it will return the correct value.


Regards,

-PJ-

2016-11-25 09-18-29
Mikael Serra

Thanks for reaching out PJ,

As I mentioned, I want my last week of 2020 to be the week 53 and I don't think rule 1 will allow this.

2020-08-14 15-28-36
Paulo Bastos

Hi, I believe there is actually a bug:

With the same settings, one function gives that 2019-12-30 is week 53, but the other function puts it on week 1 of the following year.

if https://en.wikipedia.org/wiki/ISO_week_date is to be followed, the expected result for the WeekNumber function would be 1.

2018-06-04 08-06-09
Peter Van Den Ochtend

Is there an update about this bug (because it seems to be a bug)?

We are also experiencing it with calculating the first day of week 1 (2023). Start of the week returns 9-1-2023 instead of 2-1-2023.

The parameters are:

WeekRule: 1
FirstDayOfWeek: 1
Year: 2023
WeekNumber: 1

Other systems (Outlook for example) correctly marks the week of 2-1-2023 as week 1)

I tried it on a server that is placed in our timezone. The same phenomenon occurs, so it doesn't seems to be a conversion to a different time zone. (?)

UserImage.jpg
Pako

Is this bug solved? I'm having the same issue. 

2021-06-21 10-55-20
Camiel van der Velden

I am experiencing the same issue in my current project. 

The first day of week 1 in this year should be the 2nd of January. Not the 9th. Settings are on default which should be okay.


2023-06-05 07-19-38
Hanneke Quaedvlieg

I have found the cause of the bug: the action does not take into account when a year has 53 weeks (as for example 2022 and 2026 do). @Matthias Preuter  can you fix this?Thnx a million!

Hanneke Quaedvlieg

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.