Date plugin: wrong weeknumber?

Hi there,

I am using the date plugin to get the weeknumber of certain dates. But when i try getWeekOfYear(date(“2024-10-13”)) the result is 42. But according to Epoch Converter is should be 41

I know in the US for example the week starts on Sunday, but in Weweb GetWeekOfYear should use the the iso-8601 standard or am I wrong?

Also tried
getWeekOfYear(toDateIso(date(“2024-10-13”))) or converting time zone to the zone I am in, but without correct result.

from the code on github it looks like the week of year function uses the default locale, that’s why you have the incorrect value.
It would be nice to have the loaded dayjs library exposed in the plugin (the same way the supabase instance is exposed), in this way we could manage more specific cases like rhis one.

1 Like

Thanks for making that clear. Is there a working NPM package (using the npm plugin) i can usez or can I override the locale used in that function?