Because in Bubble.io, as in JavaScript, and many other programming languages (although not all), a Week starts on Sunday:

Sunday = 0
Monday = 1
Tuesday = 2
Wednesday = 3
Thursday = 4
Friday = 5
Saturday = 6

But the ISO 8601 standard doesn’t care about JavaScript (or any other specific language).

In vanilla Javascript there is no built in way to establish the Week from a given Date, but libraries like Luxon.js or (the outdated/deprecated) moment.js (which is what Bubble still uses for Dates) have built in methods for getting the week of given Date, which follow the ISO standard of Weeks (at least in the context of establishing the week number) starting on Monday.

Confusing? yep… (dates/timezones really are…)

2 Likes