Open Langveisfra opened 1 year ago
I'm struggling to reproduce this. When the fault happens can you say please
One more question:
Thanks. Does this happen on standard MRBS 1.11.3, or have you made any changes to the MRBS code?
The 1.11.3 is taken from det dev source one week ago. I can also put up a standard 1.11.3. I'll post you the address in 15 minutes.
A clean 1.11.3 install gives the same result.
Thanks. What version of PHP are you running?
8.2.10 (A test server with 8.2.5 gives the same result)
Another finding: $view_week_number = true; $mincals_weeknumbers = false; -hides week numbers both in mini calendar and in main calendar_
$view_week_number = false;
$mincals_week_numbers = true;
-hides week numbers in mini calendar, but shows week numbers in main calendar (but wrong week number).
Is it possible to let week numbers just show up in mini calendar (as they are displayed correctly here), and not in the main calendar (main mindow - week view, where they are not displaying correctly)?
Could you run the attached test program please on your server (you'll need to unzip it first) and post the output? The output should look something like
PHP version: 8.3.0RC2
System: Windows NT SNOWDROP 10.0 build 22621 (Windows 11) AMD64
Server: Microsoft-IIS/10.0
Date (strftime): 2023-09-22
Week (strftime): 38
Week (intl) (nb): 38
Week (intl) (nn): 38
Week (intl) (no): 38
Is it possible to let week numbers just show up in mini calendar (as they are displayed correctly here), and not in the main calendar (main mindow - week view, where they are not displaying correctly)?
Now fixed in 2b3f038.
Could you run the attached test program please on your server (you'll need to unzip it first) and post the output? The output should look something like
PHP version: 8.3.0RC2 System: Windows NT SNOWDROP 10.0 build 22621 (Windows 11) AMD64 Server: Microsoft-IIS/10.0 Date (strftime): 2023-09-22 Week (strftime): 38 Week (intl) (nb): 38 Week (intl) (nn): 38 Week (intl) (no): 38
Here is the output:
PHP version: 8.2.10 System: Linux ws36 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 Server: Apache/2.4.41 Date (strftime): 2023-09-22 Week (strftime): 38 Week (intl) (nb): 38 Week (intl) (nn): 38 Week (intl) (no): 38
Thanks. Could you try the attached version of index.php please and see if it fixes the problem?
Thank you for your effort! Unfortunately, it did not solve the problem. Tested on 1.11.2 and 1.11.3.
Here's another version of index.php. This time it's a diagnostic version and should give output like
2023-9-22 (1695340800) Uke 38 | 18. - 24. september 202
Can you let me know what it says on your system?
2023-9-22 (1695376800) Uke 39 | 18. - 24. september 2023 (both 1.11.2/1.11.3)
And in addition could you use this diagnostic version of lib/IntlDateFormatter.php please? You should get output like
2023-9-23 (1695427200) Uke %J:38 | %i.:18. - %i. %B %Y:24. september 2023
Replaced the lib/IntlDateFormatter.php with the file posted above. No difference in the main calendar. 2023-9-22 (1695376800) Uke 39 | 18. - 24. september 2023
Should the output appear somewhere else?
OK, that's fine. Thanks. It's actually what I'd expect.
And can you use the attached version of language.inc? The output should look like
2023-9-23 (1695463200) Uke (nb)38 | (nb)18. - (nb)24. september 2023
2023-9-22 (1695376800) Uke (no-NB)39 | (no-NB)18. - (no-NB)24. september 2023
Ah! Can you set
$override_locale = 'nb-NO'; // or just 'nb'
nb is the language and NO is the country (in this case), so you have them in the wrong order. I think that will solve the problem.
(Or you could just not set $override_locale
locale at all and use the browser's language preferences).
Oh - that was sloppy of me. It did the trick. Campbell for president! :-)
Good, glad it's working. I'm not sure why PHP was behaving this way though, even with an invalid locale. I have raised an issue on PHP.
$faqfilelang = "no"; $override_locale = "nb-NO"; gives correct week numbers, but day names of the mini-calendar shows up in nynorsk ("nn-NO")
$disable_automatic_language_changing = true; $default_language_tokens = "no"; on the other hand gives right weeknumbers and day names in bokmål ("nb-NO")
I've raised this as a separate issue at #3517 .
I have reopened this issue as a reminder to fix the week number problem properly. MRBS should not allow an invalid locale to be passed to IntlDateFormatter::construct
.
The week view and the mini calendar do not show the same week number. The desired week number is according to the ISO 8601 that gives week number 1 to the first week of year that contains a Thursday.
The mini calendar shows the right number, the week view does not. Here are the relevant variables of my config.inc.php-file: $view_week_number = true; $mincals_week_numbers = true; $weekstarts = 1;
I run MRBS v. 1.11.3