mirror of https://github.com/acanas/swad-core.git
Version 16.205.2
This commit is contained in:
parent
4bdc1c4cad
commit
1679b6c02b
|
@ -54,6 +54,7 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
|||
var todayDay = today.getDate();
|
||||
var d = new Date();
|
||||
var WriteDate;
|
||||
var WriteTodayStr;
|
||||
var Yea;
|
||||
var Mon;
|
||||
var Day;
|
||||
|
@ -84,37 +85,28 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
|||
|
||||
/* Set date */
|
||||
if (WriteDate) {
|
||||
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;
|
||||
WriteTodayStr = false;
|
||||
if (StrToday != null)
|
||||
if (StrToday.length &&
|
||||
Yea == todayYea &&
|
||||
Mon == todayMon &&
|
||||
Day == todayDay) // Today
|
||||
WriteTodayStr = true;
|
||||
|
||||
if (WriteTodayStr)
|
||||
StrDate = StrToday;
|
||||
else {
|
||||
switch (DateFormat) {
|
||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
||||
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
||||
StrDay = ((Day < 10) ? '0' : '') + Day;
|
||||
StrDate = Yea.toString() + '-' + StrMon + '-' + StrDay;
|
||||
break;
|
||||
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
||||
StrDate = StrDay + ' ' + StrMon + ' ' + Yea.toString();
|
||||
StrDate = Day.toString() + ' ' + MonthsShort[Mon - 1] + ' ' + Yea.toString();
|
||||
break;
|
||||
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
||||
StrDate = StrMon + ' ' + StrDay + ', ' + Yea.toString();
|
||||
StrDate = MonthsShort[Mon - 1] + ' ' + Day.toString() + ', ' + Yea.toString();
|
||||
break;
|
||||
default:
|
||||
StrDate = '';
|
||||
|
|
|
@ -233,13 +233,14 @@
|
|||
/****************************** Public constants *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.205.1 (2017-05-04)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 16.205.2 (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.2: May 04, 2017 Changes in form to select date format. (218439 lines)
|
||||
Version 16.205.1: May 04, 2017 Removed unused code. (218440 lines)
|
||||
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)
|
||||
|
|
10
swad_date.c
10
swad_date.c
|
@ -131,11 +131,17 @@ void Dat_PutIconsToSelectDateFormat (void)
|
|||
if (Format == Gbl.Prefs.DateFormat)
|
||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
|
||||
"%s"
|
||||
"<span id=\"date_format_%u\"></span>"
|
||||
"</label>"
|
||||
"</li>",
|
||||
Gbl.Form.Id,
|
||||
Dat_Format_Str[Format]);
|
||||
(unsigned) Format);
|
||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||
"writeLocalDateHMSFromUTC('date_format_%u',%ld,"
|
||||
"%u,', ',null,true,false,false);"
|
||||
"</script>",
|
||||
(unsigned) Format,(long) Gbl.StartExecutionTimeUTC,
|
||||
(unsigned) Format);
|
||||
}
|
||||
|
||||
/***** End of list and form *****/
|
||||
|
|
|
@ -460,8 +460,6 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
|||
"</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 *****/
|
||||
|
|
Loading…
Reference in New Issue