It is currently March 29th, 2024, 8:40 am

Wrong week number

Report bugs with the Rainmeter application and suggest features.
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Wrong week number

Post by Chewtoy »

TheAslan reported something very interesting that I had overlooked compleatly.
The week-reading in rainmeter is wrong!

Code: Select all

[MeasureWeek]
Measure=Time
Format=%W
;Format=%U
This SHOULD give the current week, but it doesn't. It gives CurrentWeek-1 for some godforsaken reason.

It's really a easy fix for it, but it's annoying and it's in basically every skin.

To fix it, I used:

Code: Select all

[MeasureWeek]
Measure=Time
Format=%W
;Format=%U
;%U is for sunday as first day of the week, %W is with monday as first day.

[MeasureWeek1]
Measure=Calc
Formula=(MeasureWeek)+1
in my SimpleCalendar. But it's really really strange and I can't understand why rainmeter does this...

---------------

I am using 0.14 btw. Not suer what TheAslan is using... --> Here's a link to where he posted the bug btw http://vonsmallhausen.deviantart.com/art/SimpleMeter-v1-02-130177616
I don't think, therefore I'm not.
User avatar
Arne Anka
Posts: 100
Joined: April 18th, 2009, 11:31 am
Location: Sweden

Re: Wrong week number

Post by Arne Anka »

Chewtoy wrote:TheAslan reported something very interesting that I had overlooked compleatly.
The week-reading in rainmeter is wrong!

Code: Select all

[MeasureWeek]
Measure=Time
Format=%W
;Format=%U
This SHOULD give the current week, but it doesn't. It gives CurrentWeek-1 for some godforsaken reason.

It's really a easy fix for it, but it's annoying and it's in basically every skin.

To fix it, I used:

Code: Select all

[MeasureWeek]
Measure=Time
Format=%W
;Format=%U
;%U is for sunday as first day of the week, %W is with monday as first day.

[MeasureWeek1]
Measure=Calc
Formula=(MeasureWeek)+1
in my SimpleCalendar. But it's really really strange and I can't understand why rainmeter does this...

---------------

I am using 0.14 btw. Not suer what TheAslan is using... --> Here's a link to where he posted the bug btw http://vonsmallhausen.deviantart.com/art/SimpleMeter-v1-02-130177616
Me think it's because of Microsoft, not Rainmeter! Or did you ever have to make use of a week 0? :shock:
From microsoft.com:
%U Week of year as decimal number, with Sunday as first day of week (00 – 53)

That calculation should give you 1 all the time, 'cause there's a bug in version 0.14.
You should update to a new version of Rainmeter that fixes that bug.
Livet är bara en period man ska överleva.
Som filosoferna säger: man föds, man lever och man dör ensam...
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Wrong week number

Post by Chewtoy »

The day I reported on was a wednesday, so it's not to do with on what day the week changed is made.

What I did was simply to change the date on my computer to January 1 and to December 31 to see if my problem was what I thought it was. And it was...

I am using 1.0 right now, and I still got the same skin that I built with the week fix.
And unless it's not week 37, this is fixed. But as far as I can tell, it IS week 37. So the bug remains.
But yes. It seems like it might be windows as my bbLean reports that it's week 36 now (I just made a change to take a look).
Still, it's an easy fix for rainmeter (or at least ought to be).
I don't think, therefore I'm not.