mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-29 04:53:26 +02:00
Version 15.15.3
This commit is contained in:
parent
611e835614
commit
74ca4647c3
40
js/swad.js
40
js/swad.js
|
@ -32,17 +32,43 @@ var NumUsrsCon;
|
||||||
var ListSeconds = new Array();
|
var ListSeconds = new Array();
|
||||||
var countClockConnected = 0;
|
var countClockConnected = 0;
|
||||||
|
|
||||||
// Write local date-time updated every minute
|
// Write a date in client local time
|
||||||
function writeLocalTime() {
|
function writeLocalDateFromUTC(id,secsSince1970UTC) {
|
||||||
var d = new Date;
|
var d = new Date;
|
||||||
|
|
||||||
|
d.setTime(secsSince1970UTC * 1000);
|
||||||
|
document.getElementById(id).innerHTML = d.toLocaleDateString();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write a date-time in client local time
|
||||||
|
function writeLocalDateTimeFromUTC(id,secsSince1970UTC) {
|
||||||
|
var d = new Date;
|
||||||
|
var Minutes;
|
||||||
|
var StrMinutes;
|
||||||
|
|
||||||
|
d.setTime(secsSince1970UTC * 1000);
|
||||||
|
Minutes = d.getMinutes();
|
||||||
|
StrMinutes = ((Minutes < 10) ? "0" : "") + Minutes;
|
||||||
|
document.getElementById(id).innerHTML = d.toLocaleDateString() + " " + d.getHours() + ":" + StrMinutes;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write clock in client local time updated every minute
|
||||||
|
function writeLocalClock() {
|
||||||
|
var d = new Date;
|
||||||
|
var Minutes;
|
||||||
|
var StrMinutes;
|
||||||
var PrintableDate;
|
var PrintableDate;
|
||||||
|
|
||||||
d.setTime(secondsSince1970UTC * 1000);
|
|
||||||
PrintableDate = d.toLocaleDateString() + "<br />" + d.getHours() + ":" + d.getMinutes();
|
|
||||||
document.getElementById('hm').innerHTML = PrintableDate;
|
|
||||||
|
|
||||||
secondsSince1970UTC += 60; // For next call
|
|
||||||
setTimeout("writeLocalTime()",60000);
|
setTimeout("writeLocalTime()",60000);
|
||||||
|
|
||||||
|
d.setTime(secondsSince1970UTC * 1000);
|
||||||
|
secondsSince1970UTC += 60; // For next call
|
||||||
|
|
||||||
|
Minutes = d.getMinutes();
|
||||||
|
StrMinutes = ((Minutes < 10) ? "0" : "") + Minutes;
|
||||||
|
// PrintableDate = d.toLocaleDateString() + "<br />" + d.getHours() + ":" + StrMinutes;
|
||||||
|
PrintableDate = d.getHours() + ":" + StrMinutes;
|
||||||
|
document.getElementById('hm').innerHTML = PrintableDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeClockConnected() {
|
function writeClockConnected() {
|
||||||
|
|
|
@ -107,11 +107,13 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.15.1 (2015/10/21)"
|
#define Log_PLATFORM_VERSION "SWAD 15.15.3 (2015/10/21)"
|
||||||
|
|
||||||
// Number of lines (includes comments but not blank lines) has been got with the following command:
|
// 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
|
// nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1
|
||||||
/*
|
/*
|
||||||
|
Version 15.15.3: Oct 21, 2015 File date-time is displayed in client local date-time. (186264 lines)
|
||||||
|
Version 15.15.2: Oct 21, 2015 Fixed bug in client local date-time. (186254 lines)
|
||||||
Version 15.15.1: Oct 21, 2015 Top-left date-time is now displayed in local time. (186249 lines)
|
Version 15.15.1: Oct 21, 2015 Top-left date-time is now displayed in local time. (186249 lines)
|
||||||
Version 15.15: Oct 19, 2015 Statistic figure about institutions can be displayed as a class photo or as a list. (186251 lines)
|
Version 15.15: Oct 19, 2015 Statistic figure about institutions can be displayed as a class photo or as a list. (186251 lines)
|
||||||
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
|
Version 15.14.2: Oct 16, 2015 Minor changes in layout. (186166 lines)
|
||||||
|
|
17
swad_date.c
17
swad_date.c
|
@ -208,23 +208,6 @@ void Dat_GetLocalTimeFromClock (const time_t *clock)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/********************** Write date from struct tblock ************************/
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
void Dat_WriteDateTimeFromtblock (void)
|
|
||||||
{
|
|
||||||
Dat_WriteDateFromtblock ();
|
|
||||||
fprintf (Gbl.F.Out," %02d:%02d",
|
|
||||||
Gbl.tblock->tm_hour,Gbl.tblock->tm_min);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Dat_WriteDateFromtblock (void)
|
|
||||||
{
|
|
||||||
fprintf (Gbl.F.Out,"%02d/%02d/%02d",
|
|
||||||
Gbl.tblock->tm_mday,1+Gbl.tblock->tm_mon,Gbl.tblock->tm_year%100);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/********* Convert a struct with Day, Month and Year to a date string ********/
|
/********* Convert a struct with Day, Month and Year to a date string ********/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -74,8 +74,6 @@ bool Dat_GetDateTimeFromYYYYMMDDHHMMSS (struct DateTime *DateTime,const char *YY
|
||||||
void Dat_ShowCurrentDateTime (void);
|
void Dat_ShowCurrentDateTime (void);
|
||||||
|
|
||||||
void Dat_GetLocalTimeFromClock (const time_t *clock);
|
void Dat_GetLocalTimeFromClock (const time_t *clock);
|
||||||
void Dat_WriteDateTimeFromtblock (void);
|
|
||||||
void Dat_WriteDateFromtblock (void);
|
|
||||||
void Dat_ConvDateToDateStr (struct Date *Date,char *DateStr);
|
void Dat_ConvDateToDateStr (struct Date *Date,char *DateStr);
|
||||||
|
|
||||||
void Dat_WriteFormIniEndDates (void);
|
void Dat_WriteFormIniEndDates (void);
|
||||||
|
|
|
@ -5824,6 +5824,8 @@ static void Brw_WriteDatesAssignment (void)
|
||||||
|
|
||||||
static void Brw_WriteFileSizeAndDate (Brw_FileType_t FileType,struct FileMetadata *FileMetadata)
|
static void Brw_WriteFileSizeAndDate (Brw_FileType_t FileType,struct FileMetadata *FileMetadata)
|
||||||
{
|
{
|
||||||
|
static unsigned UniqueId = 0;
|
||||||
|
|
||||||
/***** Write the file size *****/
|
/***** Write the file size *****/
|
||||||
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
|
fprintf (Gbl.F.Out,"<td class=\"%s RIGHT_MIDDLE COLOR%u\">"
|
||||||
" ",
|
" ",
|
||||||
|
@ -5839,8 +5841,13 @@ static void Brw_WriteFileSizeAndDate (Brw_FileType_t FileType,struct FileMetadat
|
||||||
if (FileType == Brw_IS_FILE ||
|
if (FileType == Brw_IS_FILE ||
|
||||||
FileType == Brw_IS_LINK)
|
FileType == Brw_IS_LINK)
|
||||||
{
|
{
|
||||||
Dat_GetLocalTimeFromClock (&(FileMetadata->Time));
|
UniqueId++;
|
||||||
Dat_WriteDateFromtblock ();
|
fprintf (Gbl.F.Out,"<span id=\"filedate%u\"></span>"
|
||||||
|
"<script type=\"text/javascript\">"
|
||||||
|
"writeLocalDateFromUTC('filedate%u',%ld);"
|
||||||
|
"</script>",
|
||||||
|
UniqueId,
|
||||||
|
UniqueId,(long) FileMetadata->Time);
|
||||||
}
|
}
|
||||||
fprintf (Gbl.F.Out,"</td>");
|
fprintf (Gbl.F.Out,"</td>");
|
||||||
}
|
}
|
||||||
|
@ -8974,10 +8981,14 @@ void Brw_ShowFileMetadata (void)
|
||||||
"<td class=\"%s RIGHT_MIDDLE\">"
|
"<td class=\"%s RIGHT_MIDDLE\">"
|
||||||
"%s:"
|
"%s:"
|
||||||
"</td>"
|
"</td>"
|
||||||
"<td class=\"DAT LEFT_MIDDLE\">",
|
"<td id=\"filedate\" class=\"DAT LEFT_MIDDLE\">",
|
||||||
The_ClassForm[Gbl.Prefs.Theme],Txt_Date_of_creation);
|
The_ClassForm[Gbl.Prefs.Theme],Txt_Date_of_creation);
|
||||||
Dat_GetLocalTimeFromClock (&(FileMetadata.Time));
|
|
||||||
Dat_WriteDateTimeFromtblock ();
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||||
|
"writeLocalDateTimeFromUTC('filedate',%ld);"
|
||||||
|
"</script>",
|
||||||
|
(long) FileMetadata.Time);
|
||||||
|
|
||||||
fprintf (Gbl.F.Out,"</td>"
|
fprintf (Gbl.F.Out,"</td>"
|
||||||
"</tr>");
|
"</tr>");
|
||||||
|
|
||||||
|
|
|
@ -540,7 +540,7 @@ static void Lay_WriteScriptInit (void)
|
||||||
|
|
||||||
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) // Clock visible
|
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP) // Clock visible
|
||||||
fprintf (Gbl.F.Out," secondsSince1970UTC = %ld;\n"
|
fprintf (Gbl.F.Out," secondsSince1970UTC = %ld;\n"
|
||||||
" writeLocalTime();",
|
" writeLocalClock();",
|
||||||
(long) Gbl.TimeStartExecution);
|
(long) Gbl.TimeStartExecution);
|
||||||
|
|
||||||
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
|
if (Gbl.Prefs.Layout == Lay_LAYOUT_DESKTOP &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user