[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Statistics in r12501 - still a small problem

From: Stefan Küng <tortoisesvn_at_gmail.com>
Date: Thu, 03 Apr 2008 20:48:32 +0200

Norbert Unterberg wrote:
> On Wed, Apr 2, 2008 at 6:43 PM, Stefan Küng <tortoisesvn_at_gmail.com> wrote:
>> Carsten Johnsen wrote:
>>
>>
>>> The only issue I can find now is that Simons commit on March 31st
>>> 00:32:02 (monday) is counted with week 13 instead of week 14.
> [...]
>> I finally found the reason for this:
>> our function which calculates the week of the year uses the CTimeSpan
>> object for its calculation. We calculate the number of days since january
>> first (midnight). The docs for GetDays() state:
>
> BTW, <nitpicking> which rule do you use to get the week number for the
> statistics? There are different rules for different countries. US week
> #12 is not the necessarily the same week as German week #12.
> </nitpicking>
> Or does a windows calendar api exist for that?

No, Windows does not provide a function for this. But I think I have it
done right (apart from the DST issue).
Check the GetCalendarWeek() method in this file:
http://tortoisesvn.tigris.org/svn/tortoisesvn/trunk/src/TortoiseProc/StatGraphDlg.cpp

(username guest, leave password empty)

The comments should give you a hint on how the week is calculated for
the different countries.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.net

Received on 2008-04-03 20:48:44 CEST

This is an archived mail posted to the TortoiseSVN Dev mailing list.