Bug 108514 - Start of week (day) does not change with locale settings, or adhere to ISO standard
Summary: Start of week (day) does not change with locale settings, or adhere to ISO st...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.2.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-13 21:45 UTC by mirknorm
Modified: 2017-06-14 13:09 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
sun-sat week. NOR locale. (307.58 KB, image/png)
2017-06-13 21:50 UTC, mirknorm
Details
local setting for weekday and weeknumber (13.38 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-06-14 08:05 UTC, Xavier Van Wijmeersch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description mirknorm 2017-06-13 21:45:21 UTC
Description:
Sunday is considered "first day of the week" by LibreOffice (with Saturday as day 7), regardless of Locale settings or international standard.
I.e. LO have defined week to be [Sunday --> Saturday], instead of [Monday --> Sunday]

My Locale (Norwegian, Norway) have Monday (1) as first day of the week, and Sunday as last (7), in accordance with international standard (specifically ISO 8601). 

When I use either 'weeknum()' or 'weekday()' on a Sunday, it will be displayed/defined as the same weeknumber as the following monday, and weekday=1, repectively.

This also applies when I use conditinoal formatting to highlight dates:
[Date is --> This week --> Apply XYZ formatting]. This is demonstrated in the attached screenshot.

Steps to Reproduce:
1. Add a date to cell (sunday): A1 =11.06.2017
2. Cell B1 =weekday(A1) --> output: 1
3. Same for Saturday, but output as day 7

Actual Results:  
Sunday is output as First Day of the Week (1).
Saturday is output as Last Day of the Week (7).

Expected Results:
Monday should be considered First Day of the Week (1).
Sunday should be considered Last Day of the Week (7).


Reproducible: Always

User Profile Reset: No

Additional Info:
I've tried changing Locale settings around, but nothing works.
I've tested/checked this bug to be true for maxOS, Linux, and Windows.


User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:53.0) Gecko/20100101 Firefox/53.0
Comment 1 mirknorm 2017-06-13 21:50:00 UTC
Created attachment 134008 [details]
sun-sat week. NOR locale.

A quick example to show the output of formulae and highlighting.
Weekdays in Norwegian. Sunday (søndag) through Saturday (lørdag), descending order in the highlighted area.
Comment 2 Xavier Van Wijmeersch 2017-06-14 08:04:34 UTC
I can produce another behavior
step 2 the second type parameter is missing; weekday(day;type), so it will use the default Sunday
I have two different type needed for the correct day number and week number
Comment 3 Xavier Van Wijmeersch 2017-06-14 08:05:35 UTC
Created attachment 134012 [details]
local setting for weekday and weeknumber
Comment 4 Jacques Guilleron 2017-06-14 12:51:36 UTC
Hi, 
See here for further explanations:
https://help.libreoffice.org/Calc/WEEKDAY
Thank you,

Jacques
Comment 5 mirknorm 2017-06-14 13:09:04 UTC
(In reply to Jacques Guilleron from comment #4)
> Hi, 
> See here for further explanations:
> https://help.libreoffice.org/Calc/WEEKDAY
> Thank you,
> 
> Jacques

Yes, that works for specifically 'weekday()' and 'weeknum()', but it does not solve the problem of highlighting [Date is --> This week], as on a *date* basis it is still a sun-sat week. I have need of the entire date system being in type 2.

And from a usability/UX standpoint, this ought follow locale settings regardless, as this workaround isn't a solution that is readily apparant to most people. Especially if they come from another office suite, where this function automatically follows locale or other settings in the settings menus.