mirror of https://github.com/acanas/swad-core.git
Version 16.206.1
This commit is contained in:
parent
d10ff995bc
commit
26d16b8e7c
|
@ -44,9 +44,10 @@ var countClockConnected = 0;
|
|||
// Dat_FORMAT_DD_MONTH_YYYY = 1
|
||||
// Dat_FORMAT_MONTH_DD_YYYY = 2
|
||||
// separator is HTML code to write between date and time
|
||||
// WriteHMS = 3 least significant bits for hour, minute and second
|
||||
|
||||
function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
||||
WriteDateOnSameDay,WriteWeekDay,WriteSeconds) {
|
||||
WriteDateOnSameDay,WriteWeekDay,WriteHMS) {
|
||||
// HMS: Hour, Minutes, Seconds
|
||||
var today = new Date();
|
||||
var todayYea = today.getFullYear();
|
||||
|
@ -95,7 +96,7 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
|||
|
||||
if (WriteTodayStr)
|
||||
StrDate = StrToday;
|
||||
else {
|
||||
else
|
||||
switch (DateFormat) {
|
||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
||||
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
||||
|
@ -112,7 +113,6 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
|||
StrDate = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (WriteWeekDay) {
|
||||
DayOfWeek = d.getDay();
|
||||
|
@ -124,16 +124,25 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
|||
else
|
||||
StrDate = '';
|
||||
|
||||
/* Set time */
|
||||
Hou = d.getHours();
|
||||
Min = d.getMinutes();
|
||||
StrHou = ((Hou < 10) ? '0' : '') + Hou;
|
||||
StrMin = ((Min < 10) ? ':0' : ':') + Min;
|
||||
/* Set HH:MM:SS */
|
||||
StrHou = '';
|
||||
StrMin = '';
|
||||
StrSec = '';
|
||||
if (WriteSeconds) {
|
||||
Sec = d.getSeconds();
|
||||
if (Sec)
|
||||
StrSec = ((Sec < 10) ? ':0' : ':') + Sec;
|
||||
if (WriteHMS & (1<<2)) {
|
||||
// Bit 2 on => Write hour
|
||||
Hou = d.getHours();
|
||||
StrHou = ((Hou < 10) ? '0' : '') + Hou;
|
||||
if (WriteHMS & (1<<1)) {
|
||||
// Bits 2,1 on => Write minutes
|
||||
Min = d.getMinutes();
|
||||
StrMin = ((Min < 10) ? ':0' : ':') + Min;
|
||||
if (WriteHMS & 1) {
|
||||
// Bits 2,1,0 on => Write seconds
|
||||
Sec = d.getSeconds();
|
||||
if (Sec)
|
||||
StrSec = ((Sec < 10) ? ':0' : ':') + Sec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Write date and time */
|
|
@ -752,7 +752,7 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
|
|||
"<td id=\"agd_date_start_%u\" class=\"%s LEFT_BOTTOM COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('agd_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,false);"
|
||||
"%u,'<br />','%s',true,true,0x6);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
|
@ -767,7 +767,7 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
|
|||
fprintf (Gbl.F.Out,"<td id=\"agd_date_end_%u\" class=\"%s LEFT_BOTTOM COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('agd_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,false);"
|
||||
"%u,'<br />','%s',false,true,0x6);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
|
|
|
@ -381,7 +381,7 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"%u,'<br />','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Asg.TimeUTC[Dat_START_TIME],
|
||||
|
@ -400,7 +400,7 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"%u,'<br />','%s',false,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Asg.TimeUTC[Dat_END_TIME],
|
||||
|
|
|
@ -394,7 +394,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"%u,'<br />','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Att->TimeUTC[Att_START_TIME],
|
||||
|
@ -412,7 +412,7 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"%u,'<br />','%s',false,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Att->TimeUTC[Att_END_TIME],
|
||||
|
@ -3081,7 +3081,7 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
|
|||
"</label>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"<td class=\"DAT RIGHT_MIDDLE COLOR%u\">"
|
||||
|
@ -3490,7 +3490,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
|||
"<span id=\"att_date_start_%u\"></span> %s"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
|
|
|
@ -232,13 +232,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.206 (2017-05-05)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.206.1 (2017-05-05)"
|
||||
#define CSS_FILE "swad16.205.css"
|
||||
#define JS_FILE "swad16.206.js"
|
||||
#define JS_FILE "swad16.206.1.js"
|
||||
|
||||
// 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 16.206.1: May 05, 2017 Changes in Javascript function to write local date and time. (218524 lines)
|
||||
Version 16.206: May 05, 2017 Date format applied to dates written directly instead of using Javascript. (218514 lines)
|
||||
Version 16.205.4: May 05, 2017 Help about date format. (218487 lines)
|
||||
Version 16.205.3: May 04, 2017 Changes in statistics about date format. (218447 lines)
|
||||
|
|
|
@ -164,7 +164,7 @@ void Dat_PutScriptDateFormat (Dat_Format_t Format)
|
|||
{
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('date_format_%u',%ld,"
|
||||
"%u,', ',null,true,false,false);"
|
||||
"%u,'',null,true,false,0x0);"
|
||||
"</script>",
|
||||
(unsigned) Format,(long) Gbl.StartExecutionTimeUTC,
|
||||
(unsigned) Format);
|
||||
|
|
|
@ -6045,7 +6045,7 @@ static void Brw_WriteDatesAssignment (void)
|
|||
"ASG_LST_DATE_RED");
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_start_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"%u,', ','%s',true,false,0x7);"
|
||||
"</script>",
|
||||
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
@ -6066,7 +6066,7 @@ static void Brw_WriteDatesAssignment (void)
|
|||
"ASG_LST_DATE_RED");
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_end_date_%u',%ld,"
|
||||
"%u,', ','%s',false,false,true);"
|
||||
"%u,', ','%s',false,false,0x7);"
|
||||
"</script>",
|
||||
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
@ -6110,7 +6110,7 @@ static void Brw_WriteFileSizeAndDate (struct FileMetadata *FileMetadata)
|
|||
fprintf (Gbl.F.Out,"<span id=\"filedate%u\"></span>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('filedate%u',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"%u,', ','%s',true,false,0x6);"
|
||||
"</script>",
|
||||
UniqueId,
|
||||
UniqueId,(long) FileMetadata->Time,
|
||||
|
@ -9194,7 +9194,7 @@ void Brw_ShowFileMetadata (void)
|
|||
"<td id=\"filedate\" class=\"DAT LEFT_MIDDLE\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('filedate',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
|
|
|
@ -3407,7 +3407,7 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
|
|||
fprintf (Gbl.F.Out,"<td id=\"thr_date_%u\" class=\"%s LEFT_TOP %s\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('thr_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,false);"
|
||||
"%u,'<br />','%s',true,false,0x6);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Style,BgColor,
|
||||
|
|
|
@ -2072,7 +2072,7 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp)
|
|||
"<span id=\"open_time_%u\"></span>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('open_time_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>",
|
||||
Txt_Opening_of_groups,
|
||||
UniqueId,
|
||||
|
|
|
@ -3526,7 +3526,7 @@ void Msg_WriteMsgDate (time_t TimeUTC,const char *ClassBackground)
|
|||
/***** Write date and time *****/
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('msg_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"%u,', ','%s',true,false,0x6);"
|
||||
"</script>",
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
|
|
@ -704,7 +704,7 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
|||
}
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('not_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,false);"
|
||||
"%u,'<br />','%s',true,false,0x6);"
|
||||
"</script>"
|
||||
"</div>",
|
||||
UniqueId,(long) TimeUTC,
|
||||
|
|
|
@ -456,7 +456,7 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
|||
Txt_days);
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('%s',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"%u,', ','%s',true,false,0x6);"
|
||||
"</script>",
|
||||
IdFirstClickTime,(long) UsrFigures.FirstClickTimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
|
|
@ -1626,7 +1626,7 @@ static void Soc_WriteDateTime (time_t TimeUTC)
|
|||
// because it will be evaluated in a loop in JavaScript
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('%s',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"%u,', ','%s',true,false,0x6);"
|
||||
"</script>",
|
||||
IdDateTime,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
|
|
@ -1772,7 +1772,7 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
|
|||
fprintf (Gbl.F.Out,"<td id=\"log_date_%u\" class=\"LOG CENTER_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('log_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"%u,', ','%s',true,false,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Gbl.RowEvenOdd,
|
||||
|
|
|
@ -463,7 +463,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('svy_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"%u,'<br />','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Svy.TimeUTC[Svy_START_TIME],
|
||||
|
@ -481,7 +481,7 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('svy_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"%u,'<br />','%s',false,true,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Svy.TimeUTC[Svy_END_TIME],
|
||||
|
|
|
@ -681,7 +681,7 @@ static bool Tst_CheckIfNextTstAllowed (void)
|
|||
sprintf (Gbl.Message,"%s:<br /><span id=\"date_next_test\"></span>."
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('date_next_test',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>",
|
||||
Txt_You_can_not_take_a_new_test_until,
|
||||
(long) TimeNextTestUTC,
|
||||
|
@ -2857,7 +2857,7 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
|
|||
" class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,true);"
|
||||
"%u,'<br />','%s',true,false,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Gbl.RowEvenOdd,
|
||||
|
@ -7332,7 +7332,7 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
|||
fprintf (Gbl.F.Out,"<td id =\"tst_date_%u\" class=\"%s RIGHT_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"%u,', ','%s',true,false,0x7);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,ClassDat,Gbl.RowEvenOdd,
|
||||
|
@ -7716,7 +7716,7 @@ void Tst_ShowOneTestResult (void)
|
|||
"<td id=\"test\" class=\"DAT LEFT_TOP\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('test',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"%u,', ','%s',true,true,0x7);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
|
|
Loading…
Reference in New Issue