![]() |
CXTPDatePickerControl and WeekNumbers |
Post Reply ![]() |
Author | |
FSauer ![]() Groupie ![]() ![]() Joined: 10 May 2006 Location: Germany Status: Offline Points: 96 |
![]() ![]() ![]() ![]() ![]() 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. |
|
![]() |
|
zitz ![]() Senior Member ![]() Joined: 05 October 2008 Status: Offline Points: 112 |
![]() ![]() ![]() ![]() ![]() |
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
|
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |