mirror of https://github.com/acanas/swad-core.git
Version 16.205
This commit is contained in:
parent
756ac27652
commit
40ef386c36
|
@ -1215,6 +1215,7 @@ a:hover /* Default ==> underlined */
|
|||
color:#4D88A1;
|
||||
font-size:9pt;
|
||||
white-space:nowrap;
|
||||
text-transform:uppercase;
|
||||
}
|
||||
.DAY_WRK_HEAD
|
||||
{
|
|
@ -39,7 +39,7 @@ var countClockConnected = 0;
|
|||
/****************** Write a date in client local time ************************/
|
||||
//id is the id of the HTML element in which date will be written
|
||||
//TimeUTC is the date-time to write in UTC UNIX time format
|
||||
|
||||
/*
|
||||
function writeLocalDateFromUTC (id,TimeUTC,StrToday) {
|
||||
var today = new Date();
|
||||
var todayYea = today.getFullYear();
|
||||
|
@ -66,13 +66,17 @@ function writeLocalDateFromUTC (id,TimeUTC,StrToday) {
|
|||
document.getElementById(id).innerHTML = Yea + '-' + StrMon + '-' + StrDay;
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
/*************** Write a date-time in client local time **********************/
|
||||
// id is the id of the HTML element in which date-time will be written
|
||||
// TimeUTC is the date-time to write in UTC UNIX time format
|
||||
// DateFormat:
|
||||
// Dat_FORMAT_YYYY_MM_DD = 0
|
||||
// Dat_FORMAT_DD_MONTH_YYYY = 1
|
||||
// Dat_FORMAT_MONTH_DD_YYYY = 2
|
||||
// separator is HTML code to write between date and time
|
||||
|
||||
function writeLocalDateHMSFromUTC (id,TimeUTC,Separator,StrToday,
|
||||
function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
||||
WriteDateOnSameDay,WriteWeekDay,WriteSeconds) {
|
||||
// HMS: Hour, Minutes, Seconds
|
||||
var today = new Date();
|
||||
|
@ -111,16 +115,43 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,Separator,StrToday,
|
|||
|
||||
/* Set date */
|
||||
if (WriteDate) {
|
||||
StrMon = ((Mon < 10) ? '-0' : '-') + Mon;
|
||||
StrDay = ((Day < 10) ? '-0' : '-') + Day;
|
||||
|
||||
switch (DateFormat) {
|
||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
||||
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
||||
break;
|
||||
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
||||
StrMon = MonthsShort[Mon - 1];
|
||||
break;
|
||||
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
||||
StrMon = MonthsShort[Mon - 1];
|
||||
break;
|
||||
default:
|
||||
StrMon = '';
|
||||
break;
|
||||
}
|
||||
StrDay = ((Day < 10) ? '0' : '') + Day;
|
||||
|
||||
if (Yea == todayYea &&
|
||||
Mon == todayMon &&
|
||||
Day == todayDay && // Today
|
||||
StrToday.length)
|
||||
StrDate = StrToday;
|
||||
else
|
||||
StrDate = Yea.toString() + StrMon + StrDay;
|
||||
else {
|
||||
switch (DateFormat) {
|
||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
||||
StrDate = Yea.toString() + '-' + StrMon + '-' + StrDay;
|
||||
break;
|
||||
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
||||
StrDate = StrDay + ' ' + StrMon + ' ' + Yea.toString();
|
||||
break;
|
||||
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
||||
StrDate = StrMon + ' ' + StrDay + ', ' + Yea.toString();
|
||||
break;
|
||||
default:
|
||||
StrDate = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (WriteWeekDay) {
|
||||
DayOfWeek = d.getDay();
|
||||
|
@ -1096,7 +1127,7 @@ function DrawMonth (id,FirstDayOfWeek,YearToDraw,MonthToDraw,CurrentMonth,Curren
|
|||
'<a href="" class="MONTH" onclick="document.getElementById(\'' + FormId +
|
||||
'\').submit();return false;">';
|
||||
}
|
||||
Gbl_HTMLContent += MONTHS_CAPS[MonthToDraw - 1] + ' ' + YearToDraw;
|
||||
Gbl_HTMLContent += Months[MonthToDraw - 1] + ' ' + YearToDraw;
|
||||
if (DrawingCalendar)
|
||||
Gbl_HTMLContent += '</div>';
|
||||
else
|
|
@ -751,22 +751,23 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
|
|||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td id=\"agd_date_start_%u\" class=\"%s LEFT_BOTTOM COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('agd_date_start_%u',"
|
||||
"%ld,'<br />','%s',true,true,false);"
|
||||
"writeLocalDateHMSFromUTC('agd_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,false);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
AgdEvent.Hidden ? Dat_TimeStatusClassHidden[AgdEvent.TimeStatus] :
|
||||
Dat_TimeStatusClassVisible[AgdEvent.TimeStatus],
|
||||
Gbl.RowEvenOdd,
|
||||
UniqueId,AgdEvent.TimeUTC[Agd_START_TIME],Txt_Today);
|
||||
UniqueId,AgdEvent.TimeUTC[Agd_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* End date/time */
|
||||
UniqueId++;
|
||||
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,'<br />','%s',false,true,false);"
|
||||
"writeLocalDateHMSFromUTC('agd_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,false);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
|
@ -774,8 +775,7 @@ static void Agd_ShowOneEvent (Agd_AgendaType_t AgendaType,long AgdCod)
|
|||
Dat_TimeStatusClassVisible[AgdEvent.TimeStatus],
|
||||
Gbl.RowEvenOdd,
|
||||
UniqueId,AgdEvent.TimeUTC[Agd_END_TIME],
|
||||
|
||||
Txt_Today);
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Event */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">"
|
||||
|
|
|
@ -380,12 +380,12 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_date_start_%u',"
|
||||
"%ld,'<br />','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('asg_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
Asg.TimeUTC[Dat_START_TIME],Txt_Today);
|
||||
UniqueId,Asg.TimeUTC[Dat_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* End date/time */
|
||||
UniqueId++;
|
||||
|
@ -399,12 +399,12 @@ static void Asg_ShowOneAssignment (long AsgCod,bool PrintView)
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_date_end_%u',"
|
||||
"%ld,'<br />','%s',false,true,true);"
|
||||
"writeLocalDateHMSFromUTC('asg_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,
|
||||
Asg.TimeUTC[Dat_END_TIME],Txt_Today);
|
||||
UniqueId,Asg.TimeUTC[Dat_END_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Assignment title */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
|
||||
|
|
|
@ -393,11 +393,12 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',"
|
||||
"%ld,'<br />','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Att->TimeUTC[Att_START_TIME],Txt_Today);
|
||||
UniqueId,Att->TimeUTC[Att_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* End date/time */
|
||||
fprintf (Gbl.F.Out,"<td id=\"att_date_end_%u\" class=\"%s LEFT_TOP",
|
||||
|
@ -410,11 +411,12 @@ static void Att_ShowOneAttEvent (struct AttendanceEvent *Att,bool ShowOnlyThisAt
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_end_%u',"
|
||||
"%ld,'<br />','%s',false,true,true);"
|
||||
"writeLocalDateHMSFromUTC('att_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Att->TimeUTC[Att_END_TIME],Txt_Today);
|
||||
UniqueId,Att->TimeUTC[Att_END_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Attendance event title */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
|
||||
|
@ -3078,8 +3080,8 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
|
|||
"<span id=\"att_date_start_%u\"></span> %s"
|
||||
"</label>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"<td class=\"DAT RIGHT_MIDDLE COLOR%u\">"
|
||||
|
@ -3091,7 +3093,7 @@ static void Att_ListEventsToSelect (Att_TypeOfView_t TypeOfView)
|
|||
Gbl.RowEvenOdd,
|
||||
NumAttEvent,UniqueId,Gbl.AttEvents.Lst[NumAttEvent].Title,
|
||||
UniqueId,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
|
||||
Txt_Today,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today,
|
||||
Gbl.RowEvenOdd,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].NumStdsTotal);
|
||||
}
|
||||
|
@ -3487,8 +3489,8 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
|||
" alt=\"%s\" title=\"%s\" class=\"ICO20x20\" />"
|
||||
"<span id=\"att_date_start_%u\"></span> %s"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('att_date_start_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
|
@ -3506,7 +3508,7 @@ static void Att_ListAttEventsForAStd (unsigned NumStd,struct UsrData *UsrDat)
|
|||
UniqueId,
|
||||
Gbl.AttEvents.Lst[NumAttEvent].Title,
|
||||
UniqueId,Gbl.AttEvents.Lst[NumAttEvent].TimeUTC[Att_START_TIME],
|
||||
Txt_Today);
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/***** Write comments for this student *****/
|
||||
if (ShowCommentStd || ShowCommentTch)
|
||||
|
|
|
@ -233,13 +233,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.204 (2017-05-04)"
|
||||
#define CSS_FILE "swad16.202.css"
|
||||
#define JS_FILE "swad16.181.js"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.205 (2017-05-04)"
|
||||
#define CSS_FILE "swad16.205.css"
|
||||
#define JS_FILE "swad16.205.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.205: May 04, 2017 Dates written depending on user's preferences. (218721 lines)
|
||||
Version 16.204: May 04, 2017 Form in preferences to change date format. (218656 lines)
|
||||
3 changes necessary in database:
|
||||
INSERT INTO actions (ActCod,Language,Obsolete,Txt) VALUES ('1638','es','N','Cambiar formato de fecha');
|
||||
|
|
12
swad_date.c
12
swad_date.c
|
@ -1444,6 +1444,7 @@ void Dat_AssignDate (struct Date *DateDst,struct Date *DateSrc)
|
|||
void Dat_WriteScriptMonths (void)
|
||||
{
|
||||
extern const char *Txt_MONTHS_SMALL[12];
|
||||
extern const char *Txt_MONTHS_SMALL_SHORT[12];
|
||||
unsigned NumMonth;
|
||||
|
||||
fprintf (Gbl.F.Out,"var Months = [");
|
||||
|
@ -1456,4 +1457,15 @@ void Dat_WriteScriptMonths (void)
|
|||
fprintf (Gbl.F.Out,"'%s'",Txt_MONTHS_SMALL[NumMonth]);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"];\n");
|
||||
|
||||
fprintf (Gbl.F.Out,"var MonthsShort = [");
|
||||
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");
|
||||
}
|
||||
|
|
|
@ -6044,11 +6044,11 @@ static void Brw_WriteDatesAssignment (void)
|
|||
Gbl.FileBrowser.Asg.Open ? "ASG_LST_DATE_GREEN" :
|
||||
"ASG_LST_DATE_RED");
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_start_date_%u',"
|
||||
"%ld,', ','%s',true,false,true);"
|
||||
"writeLocalDateHMSFromUTC('asg_start_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"</script>",
|
||||
UniqueId,
|
||||
(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],Txt_Today);
|
||||
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
|
||||
/***** Arrow *****/
|
||||
|
@ -6065,11 +6065,11 @@ static void Brw_WriteDatesAssignment (void)
|
|||
Gbl.FileBrowser.Asg.Open ? "ASG_LST_DATE_GREEN" :
|
||||
"ASG_LST_DATE_RED");
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('asg_end_date_%u',"
|
||||
"%ld,', ','%s',false,false,true);"
|
||||
"writeLocalDateHMSFromUTC('asg_end_date_%u',%ld,"
|
||||
"%u,', ','%s',false,false,true);"
|
||||
"</script>",
|
||||
UniqueId,
|
||||
(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],Txt_Today);
|
||||
UniqueId,(long) Gbl.FileBrowser.Asg.TimeUTC[Dat_END_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
fprintf (Gbl.F.Out,"</span>");
|
||||
}
|
||||
else
|
||||
|
@ -6109,11 +6109,12 @@ static void Brw_WriteFileSizeAndDate (struct FileMetadata *FileMetadata)
|
|||
UniqueId++;
|
||||
fprintf (Gbl.F.Out,"<span id=\"filedate%u\"></span>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('filedate%u',"
|
||||
"%ld,', ','%s',true,false,false);"
|
||||
"writeLocalDateHMSFromUTC('filedate%u',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"</script>",
|
||||
UniqueId,
|
||||
UniqueId,(long) FileMetadata->Time,Txt_Today);
|
||||
UniqueId,(long) FileMetadata->Time,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"</td>");
|
||||
}
|
||||
|
@ -9192,14 +9193,15 @@ void Brw_ShowFileMetadata (void)
|
|||
"</td>"
|
||||
"<td id=\"filedate\" class=\"DAT LEFT_MIDDLE\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('filedate',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('filedate',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
The_ClassForm[Gbl.Prefs.Theme],
|
||||
Txt_Date_of_creation,
|
||||
(long) FileMetadata.Time,Txt_Today);
|
||||
(long) FileMetadata.Time,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/***** Private or public? *****/
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
|
|
|
@ -3406,12 +3406,13 @@ static void For_ListForumThrs (long ThrCods[Pag_ITEMS_PER_PAGE],
|
|||
UniqueId++;
|
||||
fprintf (Gbl.F.Out,"<td id=\"thr_date_%u\" class=\"%s LEFT_TOP %s\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('thr_date_%u',"
|
||||
"%ld,'<br />','%s',true,false,false);"
|
||||
"writeLocalDateHMSFromUTC('thr_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,false);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Style,BgColor,
|
||||
UniqueId,(long) TimeUTC,Txt_Today);
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
}
|
||||
else
|
||||
for (Column = 1;
|
||||
|
|
|
@ -2071,12 +2071,13 @@ static void Grp_WriteGrpHead (struct GroupType *GrpTyp)
|
|||
fprintf (Gbl.F.Out,"<br />%s: "
|
||||
"<span id=\"open_time_%u\"></span>"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('open_time_%u',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('open_time_%u',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>",
|
||||
Txt_Opening_of_groups,
|
||||
UniqueId,
|
||||
UniqueId,(long) GrpTyp->OpenTimeUTC,Txt_Today);
|
||||
UniqueId,(long) GrpTyp->OpenTimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
}
|
||||
fprintf (Gbl.F.Out,"</td>"
|
||||
"</tr>");
|
||||
|
|
|
@ -3525,10 +3525,11 @@ 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,', ','%s',true,false,false);"
|
||||
"writeLocalDateHMSFromUTC('msg_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"</script>",
|
||||
UniqueId,(long) TimeUTC,Txt_Today);
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/***** End cell *****/
|
||||
fprintf (Gbl.F.Out,"</td>");
|
||||
|
|
|
@ -703,11 +703,12 @@ static void Not_DrawANotice (Not_Listing_t TypeNoticesListing,
|
|||
Act_FormEnd ();
|
||||
}
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('not_date_%u',"
|
||||
"%ld,'<br />','%s',true,false,false);"
|
||||
"writeLocalDateHMSFromUTC('not_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,false);"
|
||||
"</script>"
|
||||
"</div>",
|
||||
UniqueId,(long) TimeUTC,Txt_Today);
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/***** Write the content of the notice *****/
|
||||
if (TypeNoticesListing == Not_LIST_BRIEF_NOTICES)
|
||||
|
|
|
@ -455,10 +455,13 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
|||
(UsrFigures.NumDays == 1) ? Txt_day :
|
||||
Txt_days);
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateFromUTC('%s',%ld,'%s');"
|
||||
"</script>",
|
||||
IdFirstClickTime,
|
||||
(long) UsrFigures.FirstClickTimeUTC,Txt_Today);
|
||||
"writeLocalDateHMSFromUTC('%s',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"</script>",
|
||||
IdFirstClickTime,(long) UsrFigures.FirstClickTimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
|
||||
}
|
||||
else // First click time is unknown or user never logged
|
||||
/***** Button to fetch and store first click time *****/
|
||||
|
|
|
@ -1625,10 +1625,11 @@ static void Soc_WriteDateTime (time_t TimeUTC)
|
|||
// This must be out of the div where the output is written
|
||||
// because it will be evaluated in a loop in JavaScript
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('%s',"
|
||||
"%ld,', ','%s',true,false,false);"
|
||||
"writeLocalDateHMSFromUTC('%s',%ld,"
|
||||
"%u,', ','%s',true,false,false);"
|
||||
"</script>",
|
||||
IdDateTime,(long) TimeUTC,Txt_Today);
|
||||
IdDateTime,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -1771,12 +1771,13 @@ static void Sta_ShowDetailedAccessesList (unsigned long NumRows,MYSQL_RES *mysql
|
|||
/* Write the date-time (row[3]) */
|
||||
fprintf (Gbl.F.Out,"<td id=\"log_date_%u\" class=\"LOG CENTER_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('log_date_%u',"
|
||||
"%ld,', ','%s',true,false,true);"
|
||||
"writeLocalDateHMSFromUTC('log_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Gbl.RowEvenOdd,
|
||||
UniqueId,(long) Dat_GetUNIXTimeFromStr (row[3]),Txt_Today);
|
||||
UniqueId,(long) Dat_GetUNIXTimeFromStr (row[3]),
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Write the action */
|
||||
if (sscanf (row[4],"%ld",&ActCod) != 1)
|
||||
|
@ -8948,7 +8949,7 @@ static void Sta_GetAndShowNumUsrsPerDateFormat (void)
|
|||
Format <= (Dat_Format_t) (Dat_NUM_OPTIONS_FORMAT - 1);
|
||||
Format++)
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
"<td class=\"DAT_N CENTER_MIDDLE\">"
|
||||
"<td class=\"DAT_N LEFT_MIDDLE\">"
|
||||
"%s"
|
||||
"</td>"
|
||||
"<td class=\"DAT RIGHT_MIDDLE\">"
|
||||
|
|
|
@ -462,11 +462,12 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('svy_date_start_%u',"
|
||||
"%ld,'<br />','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('svy_date_start_%u',%ld,"
|
||||
"%u,'<br />','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Svy.TimeUTC[Svy_START_TIME],Txt_Today);
|
||||
UniqueId,Svy.TimeUTC[Svy_START_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* End date/time */
|
||||
fprintf (Gbl.F.Out,"<td id=\"svy_date_end_%u\" class=\"%s LEFT_TOP",
|
||||
|
@ -479,11 +480,12 @@ static void Svy_ShowOneSurvey (long SvyCod,struct SurveyQuestion *SvyQst,
|
|||
fprintf (Gbl.F.Out," COLOR%u",Gbl.RowEvenOdd);
|
||||
fprintf (Gbl.F.Out,"\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('svy_date_end_%u',"
|
||||
"%ld,'<br />','%s',false,true,true);"
|
||||
"writeLocalDateHMSFromUTC('svy_date_end_%u',%ld,"
|
||||
"%u,'<br />','%s',false,true,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Svy.TimeUTC[Svy_END_TIME],Txt_Today);
|
||||
UniqueId,Svy.TimeUTC[Svy_END_TIME],
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Survey title */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP");
|
||||
|
|
28
swad_test.c
28
swad_test.c
|
@ -680,11 +680,12 @@ static bool Tst_CheckIfNextTstAllowed (void)
|
|||
/***** Write warning *****/
|
||||
sprintf (Gbl.Message,"%s:<br /><span id=\"date_next_test\"></span>."
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('date_next_test',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('date_next_test',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>",
|
||||
Txt_You_can_not_take_a_new_test_until,
|
||||
(long) TimeNextTestUTC,Txt_Today);
|
||||
(long) TimeNextTestUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
Lay_ShowAlert (Lay_WARNING,Gbl.Message);
|
||||
|
||||
return false;
|
||||
|
@ -2855,12 +2856,13 @@ static void Tst_ListOneOrMoreQuestionsToEdit (unsigned long NumRows,MYSQL_RES *m
|
|||
fprintf (Gbl.F.Out,"<td id=\"tst_date_%u\""
|
||||
" class=\"DAT_SMALL CENTER_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',"
|
||||
"%ld,'<br />','%s',true,false,true);"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',%ld,"
|
||||
"%u,'<br />','%s',true,false,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,Gbl.RowEvenOdd,
|
||||
UniqueId,(long) TimeUTC,Txt_Today);
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Write the question tags */
|
||||
fprintf (Gbl.F.Out,"<td class=\"LEFT_TOP COLOR%u\">",
|
||||
|
@ -7329,12 +7331,13 @@ static void Tst_ShowTestResults (struct UsrData *UsrDat)
|
|||
UniqueId++;
|
||||
fprintf (Gbl.F.Out,"<td id =\"tst_date_%u\" class=\"%s RIGHT_TOP COLOR%u\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',"
|
||||
"%ld,', ','%s',true,false,true);"
|
||||
"writeLocalDateHMSFromUTC('tst_date_%u',%ld,"
|
||||
"%u,', ','%s',true,false,true);"
|
||||
"</script>"
|
||||
"</td>",
|
||||
UniqueId,ClassDat,Gbl.RowEvenOdd,
|
||||
UniqueId,(long) TimeUTC,Txt_Today);
|
||||
UniqueId,(long) TimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Get number of questions (row[3]) */
|
||||
if (sscanf (row[3],"%u",&NumQstsInThisTest) != 1)
|
||||
|
@ -7712,12 +7715,13 @@ void Tst_ShowOneTestResult (void)
|
|||
"</td>"
|
||||
"<td id=\"test\" class=\"DAT LEFT_TOP\">"
|
||||
"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('test',"
|
||||
"%ld,', ','%s',true,true,true);"
|
||||
"writeLocalDateHMSFromUTC('test',%ld,"
|
||||
"%u,', ','%s',true,true,true);"
|
||||
"</script>"
|
||||
"</td>"
|
||||
"</tr>",
|
||||
Txt_Date,TstTimeUTC,Txt_Today);
|
||||
Txt_Date,TstTimeUTC,
|
||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||
|
||||
/* Number of questions */
|
||||
fprintf (Gbl.F.Out,"<tr>"
|
||||
|
|
Loading…
Reference in New Issue