Description: Format > Conditional > Condition > More rules > Date is > Last week Shows 8 conditionally formatted dates instead of 7 on Sundays. Method: Open Attachments - video (my screencast of short explanation of problem) - ods file I’ve read that Date is: Last / This / Next week is locale dependent and cause I use a lot of mixed locale I created custom formulas for Last / This / Next week with week starting on Monday and Sunday. If I didn’t I wouldn’t notice it. Open file: Columns: 1. Week Start: Mon – Custom formula 2. Locale dependent – Calc inbuilt conditional formatting – Date is: Last / This / Next week 3. Locale dependent – Formula I got from .xls (Excel 97-2003 file) made in Excel 365 4. Week Start: Sun – Custom formula Try to set manual date and press delete on empty cell so it can recalculate. If set on Sunday you will see that Calc inbuilt conditional formatting – Date is: Last week if day is Sunday doesn’t work correctly. It conditionally formats 8 days instead of 7 days. With “View > Show formulas” you can see that dates and added / subtracted from TODAY() in middle. That seems not to be the problem. Cause if you paste date as values problem still persists. To see formulas for Conditional Formatting: Format > Conditional > Manage Tried: - many LibreOffice versions - many Linux distorts (even online) - Windows in VM - resetting user profile - resetting mixed locale - recreating file in MS Excel 365 and opening it in Calc. and they all show the same mistake. Steps to Reproduce: - Actual Results: - Expected Results: - Reproducible: Always User Profile Reset: Yes Additional Info: -
Created attachment 197518 [details] Calc inbuilt conditional formatting Date is Last week not working
I think, it is an error in https://opengrok.libreoffice.org/xref/core/sc/source/core/data/conditio.cxx?r=621caf93#1649 condformat::NEXTWEEK is true, when rActDate+7 fulfills the conditions of THISWEEK. And condformat::LASTWEEK is true, when rActDate-7 fulfills the conditions of THISWEEK. That is true for all cases but LASTWEEK case sunday. It should be begin = rActDay-7, end = rActDay-7 + 6 but it is begin = rActDay-8, end = rActDay-1
Eike Rathke, I added you here. Can you please take a look?