Skip to content
Snippets Groups Projects
Commit 2529ab67 authored by yograj tandel's avatar yograj tandel Committed by Mohammed Shekha
Browse files

[FIX] web: datepicker week date offset

PURPOSE

The week dates computed by our datepicker do not meet the ISO 8601 standard:

The ISO 8601 definition for week 01 is the week with the first Thursday of the
Gregorian year (i.e. of January) in it.
The following definitions based on properties of this week are mutually
equivalent, since the ISO week starts with Monday:
- It is the first week with a majority (4 or more) of its days in January.
- Its first day is the Monday nearest to 1 January.
- It has 4 January in it. Hence the earliest possible first week extends from
Monday 29 December (previous Gregorian year) to Sunday 4 January, the latest
possible first week extends from Monday 4 January to Sunday 10 January.
- It has the year's first working day in it, if Saturdays, Sundays and 1
January are not working days.

If 1 January is on a Monday, Tuesday, Wednesday or Thursday, it is in W01. If
it is on a Friday, it is part of W53 of the previous year. If it is on a
Saturday, it is part of the last week of the previous year which is numbered
W52 in a common year and W53 in a leap year. If it is on a Sunday, it is part
of W52 of the previous year.
https://en.wikipedia.org/wiki/ISO_week_date#First_week



Since Jan 1st 2021 falls on a Friday, according to the ISO 8601 standard above,
the first week of 2021 is the one starting on Jan 4th.
Nevertheless, it looks like our datepicker simply assumes that the first week
of the year is simply the one including Jan 1st.

SPECIFICATION

Fix the week dates of our datepicker to meet the ISO 8601 standard.

Task - 2458112

closes odoo/odoo#70473

Signed-off-by: default avatarSimon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: default avatarMohammed Shekha <msh@odoo.com>
parent d2a44868
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment