It is currently March 28th, 2024, 10:26 pm

wrong weeknumber...?

Report bugs with the Rainmeter application and suggest features.
wislo
Posts: 7
Joined: May 19th, 2017, 11:28 am

wrong weeknumber...?

Post by wislo »

The illustro/clock module shows the wrong weeknumber….
How to correct?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: wrong weeknumber...?

Post by balala »

wislo wrote: April 16th, 2019, 3:51 pm The illustro/clock module shows the wrong weeknumber….
How to correct?
Does that skin show a week number? Where, because I can't find it?
illustro.png
You do not have the required permissions to view the files attached to this post.
wislo
Posts: 7
Joined: May 19th, 2017, 11:28 am

Re: wrong weeknumber...?

Post by wislo »

Yes it does, after you altered clock.ini....

Code: Select all

[measureTime]
; This measure returns the time in a 24-hour format (i.e. HH:MM).
Measure=Time
Format=%H:%M
; For a 12-hour clock, change the Format option above to: %I:%M %p
; Refer to the Rainmeter manual for other format codes.

[measureDate]
; Returns the date as DD.MM.YYYY
Measure=Time
Format=%d.%m.%Y

[measureDay]
; Returns the current day
Measure=Time
Format=%A

[measureWeek]
; show weeknumber
Measure=Time
Format=%W
-
-
-
[meterWeek]
Meter=String
MeterStyle=styleRightText
MeasureName=measureWeek
X=100
Y=0r
; r stands for relative. In this case, the Y postition of meterValueCPU is 0 pixels
; below the Y value of the previous meter (i.e it's the same as in meterLabelCPU).
W=190
H=14
Text=%1
Last edited by balala on May 7th, 2019, 8:33 am, edited 1 time in total.
Reason: Please use <code> tags when posting code snippets. It's the </> button.
wislo
Posts: 7
Joined: May 19th, 2017, 11:28 am

Re: wrong weeknumber...?

Post by wislo »

Can anyone tell me where the variable %W is calculated?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: wrong weeknumber...?

Post by balala »

wislo wrote: May 7th, 2019, 7:53 am Can anyone tell me where the variable %W is calculated?
Note that %W is not a variable. But what you mean by where is it calculated? The [measureWeek] measure returns the appropriate number.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm

Re: wrong weeknumber...?

Post by SilverAzide »

wislo wrote: May 7th, 2019, 7:53 am Can anyone tell me where the variable %W is calculated?
You should read this if you haven't already: https://docs.rainmeter.net/manual/measures/time/. "%W" is a time format string, not a variable.

Regarding your original question about the wrong week, read that "%W" definition carefully. Using "%W", the first week of 2019 didn't start until January 7th, because the 7th was the first Monday of the year. So December 31 2018 through January 6 2019 was the 53rd week of 2018 (or week zero of 2019, I forget which... maybe both). You might consider using "%V" instead of "%W". "%V" uses the ISO 8601 standard, which uses a different method of calculating week numbers. Using "%V", the first week of 2019 was from December 31 to January 6. 2019 is an example of a year in which "%W" and "%V" return completely different values for the entire year.

P.S.: The Rainmeter docs are incorrect for %V, in that there is never a week zero in ISO 8601 standard, weeks always start with week 1.
Gadgets Wiki GitHub More Gadgets...
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: wrong weeknumber...?

Post by jsmorley »

SilverAzide wrote: May 7th, 2019, 11:31 am P.S.: The Rainmeter docs are incorrect for %V, in that there is never a week zero in ISO 8601 standard, weeks always start with week 1.
I fixed that error in the docs months ago.

The C++ routine we use to format time codes are documented here:

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/strftime-wcsftime-strftime-l-wcsftime-l?view=vs-2017
The ISO 8601 week and week-based year produced by %V, %g, and %G, uses a week that begins on Monday, where week 1 is the week that contains January 4th, which is the first week that includes at least four days of the year. If the first Monday of the year is the 2nd, 3rd, or 4th, the preceding days are part of the last week of the preceding year. For those days, %V is replaced by 53, and both %g and %G are replaced by the digits of the preceding year.
Or put another way:
Week 19 is from Monday May 6, 2019 until (and including) Sunday May 12, 2019. Week number according to the ISO-8601 standard, weeks starting on Monday. The first week of the year is the week that contains that year's first Thursday (='First 4-day week'). The highest week number in a year is either 52 or 53.
wislo
Posts: 7
Joined: May 19th, 2017, 11:28 am

Re: wrong weeknumber...?

Post by wislo »

I understand what you are saying but still it shows the wrong weeknumber... at this moment week 20 and the date is 25-5-2019...
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: wrong weeknumber...?

Post by balala »

wislo wrote: May 25th, 2019, 4:29 pm at this moment week 20 and the date is 25-5-2019...
Which is ok, I think, because week 1 is the first full week, so if you calculate it, this week is indeed the 20th.
wislo
Posts: 7
Joined: May 19th, 2017, 11:28 am

Re: wrong weeknumber...?

Post by wislo »

@balala .... in your country different calculating? Its a matter of counting....
wknr.jpg
You do not have the required permissions to view the files attached to this post.