Home » U++ Library support » CalendarCtrl » Setting FirstDay puts day numbers out of alignment with day names
Setting FirstDay puts day numbers out of alignment with day names [message #35637] |
Fri, 09 March 2012 05:40  |
jjacksonRIAB
Messages: 227 Registered: June 2011
|
Experienced Member |
|
|
I made the following changes so that when FirstDay is changed, the calendar days will realign themselves to their names. Having tested Sat-Friday, it appears to work.
I don't know how this affects the week numbers, though, because my math with date time calculation is not too good:
int Calendar::DayOfWeek(int day, int month, int year, int zelleroffset)
{
if(month < 3)
{
month += 12 ;
year -= 1 ;
}
int n1 = (26 * (month + 1)) / 10;
int n2 = (125 * year) / 100;
return ((day + (8 - first_day) + n1 + n2 - (year / 100) + (year / 400) - zelleroffset) % 7 );
}
[Updated on: Fri, 09 March 2012 05:45] Report message to a moderator
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 11:11:44 CEST 2025
Total time taken to generate the page: 0.01111 seconds
|