From a875a3fc5958cdec6b9bba5978e9c5404abee827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Sat, 21 Nov 2015 21:00:18 +0100 Subject: [PATCH] Version 15.42.1 --- icon/first-day-of-week-0-64x64.png | Bin 0 -> 1568 bytes icon/first-day-of-week-6-64x64.png | Bin 0 -> 1616 bytes js/swad.js | 24 ++++++++++++------------ swad_calendar.c | 9 +++------ swad_changelog.h | 3 ++- swad_user.c | 10 +++++++--- 6 files changed, 24 insertions(+), 22 deletions(-) create mode 100644 icon/first-day-of-week-0-64x64.png create mode 100644 icon/first-day-of-week-6-64x64.png diff --git a/icon/first-day-of-week-0-64x64.png b/icon/first-day-of-week-0-64x64.png new file mode 100644 index 0000000000000000000000000000000000000000..b1805c9ec32cea56c6c44702a295de71f05f5d62 GIT binary patch literal 1568 zcmV+*2H*LKP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00oFiL_t(|+U;9SY!gQm{$~Ge z<2V6Ag_Np42U;PdponACIzg2{NQFWoQb7Dw5f=`C5^*J}gp>+#tdOEg=H?5+;gAC& zjuWH?E~Y(E8bKQZ9Ew7yy;<+9cV~Mji6YD1UEAw4)cYh$j^^#>nQy-L=FRK`2rRI` zYPErZ0au?RM~>8tf9%*XSD(JVzPiRB)bh~j)2ES0B*62$aPZ*4FLYhMUMv9IRsF`Ta{yr5HVTEp z;foh9wl@l2)3n1EE?j6|Hv(p7XE#$yx2z@-L7;7IZ3i-$49R3NWZSlF2Sib%EA571 zY{_P`n;VJ$=+UFi>qbC6pU2vmGz{a}%a<>oto%JcKmWuqjAv_S$uNu!gI_lRW#W(* z1YvbW5k*k|z?a6VU-<97`+{GQfWg5*r?^`Nz?|Z;#F%AS%U(O>hF@l|j`*ieo$_7> zWV2axb#-BEYz!w(ocLsMadFHrjJ=j+)iZ;iheDx+cs%Y)0ai+IIeebyAqc``YisM^ z&6_v>0DyEljo#i~X9Wxm4FLd-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+ugdZXT29}nr5t2`a+0z?i#0C)K$51 z=+L3hIOo3#AwFL&hSvB6iN}PHug1s6|ICR2-QC?UG);S!YMf@<@ML&t6?{8HRn=z) z4<3AxQwa3;_v8He^LkTL)1anl)>_U7j^jX46sw`3Verb8EBd)}=W+{yWjS%;#7DZW z|7@D(0kTOH September @@ -662,7 +662,7 @@ function Cal_DrawCalendar (id,Sunday,TimeUTC,CurrentPlcCod,PrintView, MonthId = id + '_month_' + MonthIdNum; Gbl_HTMLContent += ''; - DrawMonth (MonthId,Sunday,Year,Month,CurrentMonth,CurrentDay, + DrawMonth (MonthId,FirstDayOfWeek,Year,Month,CurrentMonth,CurrentDay, CurrentPlcCod,true,PrintView,CGI, FormGoToCalendarParams,FormEventParams); Gbl_HTMLContent += ''; @@ -682,7 +682,7 @@ function Cal_DrawCalendar (id,Sunday,TimeUTC,CurrentPlcCod,PrintView, /***************************** Draw current month ****************************/ /*****************************************************************************/ -function DrawCurrentMonth (id,Sunday,TimeUTC,CurrentPlcCod, +function DrawCurrentMonth (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod, CGI,FormGoToCalendarParams,FormEventParams) { var d = new Date; d.setTime(TimeUTC * 1000); @@ -690,7 +690,7 @@ function DrawCurrentMonth (id,Sunday,TimeUTC,CurrentPlcCod, var Month = d.getMonth() + 1; var CurrentDay = d.getDate(); - DrawMonth (id,Sunday,Year,Month,Month,CurrentDay, + DrawMonth (id,FirstDayOfWeek,Year,Month,Month,CurrentDay, CurrentPlcCod,false,false, CGI,FormGoToCalendarParams,FormEventParams); document.getElementById(id).innerHTML = Gbl_HTMLContent; @@ -699,10 +699,10 @@ function DrawCurrentMonth (id,Sunday,TimeUTC,CurrentPlcCod, /*****************************************************************************/ /******************************* Draw a month ********************************/ /*****************************************************************************/ -// Sunday == 0 ==> Sunday is the first day of the week -// Sunday == 6 ==> Sunday is the last day of the week +// FirstDayOfWeek == 0 (monday) <==> Sunday is the last day of the week +// FirstDayOfWeek == 6 (sunday) <==> Sunday is the first day of the week -function DrawMonth (id,Sunday,YearToDraw,MonthToDraw,CurrentMonth,CurrentDay, +function DrawMonth (id,FirstDayOfWeek,YearToDraw,MonthToDraw,CurrentMonth,CurrentDay, CurrentPlcCod,DrawingCalendar,PrintView, CGI,FormGoToCalendarParams,FormEventParams) { var NumDaysMonth = [ @@ -750,7 +750,7 @@ function DrawMonth (id,Sunday,YearToDraw,MonthToDraw,CurrentMonth,CurrentDay, If it's 0 then write 1 box of the previous month. If it's 1 then write 0 boxes of the previous month. */ - if ((DayOfWeek = (GetDayOfWeekMondayFirst (Yea,Mon,1) + Sunday + 1) % 7) == 0) + if ((DayOfWeek = (GetDayOfWeekMondayFirst (Yea,Mon,1) - FirstDayOfWeek) % 7) == 0) Day = 1; else { if (Mon <= 1) { @@ -787,10 +787,10 @@ function DrawMonth (id,Sunday,YearToDraw,MonthToDraw,CurrentMonth,CurrentDay, Gbl_HTMLContent += '' + ''; for (DayOfWeek = 0; DayOfWeek < 7; DayOfWeek++) Gbl_HTMLContent += ''; Gbl_HTMLContent += ''; @@ -840,7 +840,7 @@ function DrawMonth (id,Sunday,YearToDraw,MonthToDraw,CurrentMonth,CurrentDay, } /* Day being drawn is sunday? */ - if (DayOfWeek == Sunday) // All the sundays are holidays + if (DayOfWeek == 6 - FirstDayOfWeek) // All the sundays are holidays ClassForDay = (Mon == MonthToDraw) ? 'DAY_HLD' : 'DAY_HLD_LIGHT'; diff --git a/swad_calendar.c b/swad_calendar.c index a54a16588..7b44132be 100644 --- a/swad_calendar.c +++ b/swad_calendar.c @@ -149,7 +149,6 @@ void Cal_DrawCurrentMonth (void) { extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES]; char Params[256+256+Ses_LENGTH_SESSION_ID+256]; - unsigned Sunday = 6; /***** Get list of holidays *****/ if (!Gbl.Hlds.LstIsRead) @@ -170,7 +169,7 @@ void Cal_DrawCurrentMonth (void) fprintf (Gbl.F.Out,"
' + - DAYS_CAPS[(DayOfWeek + 6 - Sunday) % 7] + + DAYS_CAPS[(DayOfWeek + FirstDayOfWeek) % 7] + '