Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Calendar
  New Posts New Posts RSS Feed - CXTPDatePickerControl and WeekNumbers
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPDatePickerControl and WeekNumbers

 Post Reply Post Reply
Author
Message
FSauer View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2006
Location: Germany
Status: Offline
Points: 96
Post Options Post Options   Thanks (0) Thanks(0)   Quote FSauer Quote  Post ReplyReply Direct Link To This Post Topic: CXTPDatePickerControl and WeekNumbers
    Posted: 18 March 2010 at 8:47am
Hello @all,

i search for a possibility to set the right WeekNumbers and also a function to get the WeekNumber.

I'm using CXTPDatePickerControl and set CXTPDatePickerControl::SetShowWeekNumbers(TRUE);

My problem is, that 01.01.2010 is shown as Weeknumber 1 and it have to be Weeknumber 53.

By using CXTPDatePickerControl::SetFirstWeekOfYearDays(5); the date 01.01.2010 is shown as Weeknumber 52 and not 53 as expected.

For any help i'll be very glad.



Back to Top
zitz View Drop Down
Senior Member
Senior Member


Joined: 05 October 2008
Status: Offline
Points: 112
Post Options Post Options   Thanks (0) Thanks(0)   Quote zitz Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2010 at 9:41am
http://forum.codejock.com/forum_posts.asp?TID=15685
You need to set CXTPDatePickerControl::SetFirstWeekOfYearDays(4)

int CXXXUtils::GetFirstWeekOfYearDays()
{
    LCID lcLocalId = __lc_handle[ LC_TIME ];
    switch ( lcLocalId ) // Страны в которых действует ISO 8601
    {
    case 1036: // франция
    case 1049: // россия
    case 3082: case 1034:// испания
        return 4;
        break;
    }

    TCHAR szResult[ 5 ];
    int nResult = ::GetLocaleInfo( lcLocalId, LOCALE_IFIRSTWEEKOFYEAR , szResult, 4 );
    ASSERT( nResult == 2 );

    int iFirstWeekOfYearDays = _ttoi( szResult );
    if ( iFirstWeekOfYearDays == 2 )
    {
        return 4;
    }
    return 1;
}

Xtreme ToolkitPro v13.1.0, static, VC++6
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.125 seconds.