mirror of
https://github.com/acanas/swad-core.git
synced 2024-06-13 04:04:35 +02:00
Version 15.25.4
This commit is contained in:
parent
4b14fb8722
commit
2ae53c304a
20
js/swad.js
20
js/swad.js
|
@ -29,7 +29,7 @@ var secondsSince1970UTC;
|
|||
|
||||
// Global variables used in writeClockConnected()
|
||||
var NumUsrsCon;
|
||||
var ListSeconds = new Array();
|
||||
var ListSeconds = [];
|
||||
var countClockConnected = 0;
|
||||
|
||||
// Write a date in client local time
|
||||
|
@ -254,9 +254,11 @@ function setDateTo (Yea,Mon,Day) {
|
|||
// Write clock in client local time updated every minute
|
||||
function writeLocalClock() {
|
||||
var d;
|
||||
var H;
|
||||
var M;
|
||||
var StrM;
|
||||
var Mon;
|
||||
var Day;
|
||||
var Hou;
|
||||
var Min;
|
||||
var StrMin;
|
||||
|
||||
setTimeout('writeLocalClock()',60000);
|
||||
|
||||
|
@ -264,10 +266,12 @@ function writeLocalClock() {
|
|||
d.setTime(secondsSince1970UTC * 1000);
|
||||
secondsSince1970UTC += 60; // For next call
|
||||
|
||||
H = d.getHours();
|
||||
M = d.getMinutes();
|
||||
StrM = ((M < 10) ? '0' : '') + M;
|
||||
document.getElementById('hm').innerHTML = H + ':' + StrM;
|
||||
Mon = d.getMonth();
|
||||
Day = d.getDate();
|
||||
Hou = d.getHours();
|
||||
Min = d.getMinutes();
|
||||
StrMin = ((Min < 10) ? '0' : '') + Min;
|
||||
document.getElementById('hm').innerHTML = Day + ' ' + Months[Mon] + ', ' + Hou + ':' + StrMin;
|
||||
}
|
||||
|
||||
function writeClockConnected() {
|
||||
|
|
|
@ -108,11 +108,12 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.25.3 (2015/10/27)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 15.25.4 (2015/10/27)"
|
||||
|
||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
||||
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||
/*
|
||||
Version 15.25.4: Oct 27, 2015 Day and month are displayed in clock. (186251 lines)
|
||||
Version 15.25.3: Oct 27, 2015 Statistics computed using time UTC. (186225 lines)
|
||||
Version 15.25.2: Oct 26, 2015 Changes related to date-times. (186247 lines)
|
||||
Version 15.25.1: Oct 26, 2015 Warning about stats computed in server time instead of user's local time. (186263 lines)
|
||||
|
|
21
swad_date.c
21
swad_date.c
|
@ -977,3 +977,24 @@ void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc)
|
|||
DateDst->Day = DateSrc->Day;
|
||||
DateDst->Week = DateSrc->Week;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/****** Write script to automatically update clocks of connected users *******/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Dat_WriteScriptMonths (void)
|
||||
{
|
||||
extern const char *Txt_MONTHS_SMALL_SHORT[12];
|
||||
unsigned NumMonth;
|
||||
|
||||
fprintf (Gbl.F.Out,"var Months = [");
|
||||
for (NumMonth = 0;
|
||||
NumMonth < 12;
|
||||
NumMonth++)
|
||||
{
|
||||
if (NumMonth)
|
||||
fprintf (Gbl.F.Out,",");
|
||||
fprintf (Gbl.F.Out,"'%s'",Txt_MONTHS_SMALL_SHORT[NumMonth]);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"];\n");
|
||||
}
|
||||
|
|
|
@ -113,4 +113,6 @@ unsigned Dat_GetDayOfYear (struct Date *Date);
|
|||
void Dat_CalculateWeekOfYear (struct Date *Date);
|
||||
void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc);
|
||||
|
||||
void Dat_WriteScriptMonths (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -535,8 +535,12 @@ static void Lay_WriteScriptInit (void)
|
|||
{
|
||||
extern const char *Txt_STR_LANG_ID[Txt_NUM_LANGUAGES];
|
||||
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n"
|
||||
"function init(){\n");
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">\n");
|
||||
|
||||
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP)
|
||||
Dat_WriteScriptMonths ();
|
||||
|
||||
fprintf (Gbl.F.Out,"function init(){\n");
|
||||
|
||||
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
|
||||
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN)) // Right column visible
|
||||
|
|
Loading…
Reference in New Issue
Block a user