mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-28 20:43:27 +02:00
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 todayDay = today.getDate();
|
||||||
var d = new Date();
|
var d = new Date();
|
||||||
var WriteDate;
|
var WriteDate;
|
||||||
|
var WriteTodayStr;
|
||||||
var Yea;
|
var Yea;
|
||||||
var Mon;
|
var Mon;
|
||||||
var Day;
|
var Day;
|
||||||
|
@ -84,37 +85,28 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,DateFormat,Separator,StrToday,
|
||||||
|
|
||||||
/* Set date */
|
/* Set date */
|
||||||
if (WriteDate) {
|
if (WriteDate) {
|
||||||
switch (DateFormat) {
|
WriteTodayStr = false;
|
||||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
if (StrToday != null)
|
||||||
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
if (StrToday.length &&
|
||||||
break;
|
Yea == todayYea &&
|
||||||
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
Mon == todayMon &&
|
||||||
StrMon = MonthsShort[Mon - 1];
|
Day == todayDay) // Today
|
||||||
break;
|
WriteTodayStr = true;
|
||||||
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
|
||||||
StrMon = MonthsShort[Mon - 1];
|
if (WriteTodayStr)
|
||||||
break;
|
StrDate = StrToday;
|
||||||
default:
|
|
||||||
StrMon = '';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
StrDay = ((Day < 10) ? '0' : '') + Day;
|
|
||||||
|
|
||||||
if (Yea == todayYea &&
|
|
||||||
Mon == todayMon &&
|
|
||||||
Day == todayDay && // Today
|
|
||||||
StrToday.length)
|
|
||||||
StrDate = StrToday;
|
|
||||||
else {
|
else {
|
||||||
switch (DateFormat) {
|
switch (DateFormat) {
|
||||||
case 0: // Dat_FORMAT_YYYY_MM_DD
|
case 0: // Dat_FORMAT_YYYY_MM_DD
|
||||||
|
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
||||||
|
StrDay = ((Day < 10) ? '0' : '') + Day;
|
||||||
StrDate = Yea.toString() + '-' + StrMon + '-' + StrDay;
|
StrDate = Yea.toString() + '-' + StrMon + '-' + StrDay;
|
||||||
break;
|
break;
|
||||||
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
case 1: // Dat_FORMAT_DD_MONTH_YYYY
|
||||||
StrDate = StrDay + ' ' + StrMon + ' ' + Yea.toString();
|
StrDate = Day.toString() + ' ' + MonthsShort[Mon - 1] + ' ' + Yea.toString();
|
||||||
break;
|
break;
|
||||||
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
case 2: // Dat_FORMAT_MONTH_DD_YYYY
|
||||||
StrDate = StrMon + ' ' + StrDay + ', ' + Yea.toString();
|
StrDate = MonthsShort[Mon - 1] + ' ' + Day.toString() + ', ' + Yea.toString();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
StrDate = '';
|
StrDate = '';
|
||||||
|
|
|
@ -233,13 +233,14 @@
|
||||||
/****************************** Public constants *****************************/
|
/****************************** 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 CSS_FILE "swad16.205.css"
|
||||||
#define JS_FILE "swad16.205.js"
|
#define JS_FILE "swad16.205.js"
|
||||||
|
|
||||||
// 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 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.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.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)
|
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)
|
if (Format == Gbl.Prefs.DateFormat)
|
||||||
fprintf (Gbl.F.Out," checked=\"checked\"");
|
fprintf (Gbl.F.Out," checked=\"checked\"");
|
||||||
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
|
fprintf (Gbl.F.Out," onclick=\"document.getElementById('%s').submit();\" />"
|
||||||
"%s"
|
"<span id=\"date_format_%u\"></span>"
|
||||||
"</label>"
|
"</label>"
|
||||||
"</li>",
|
"</li>",
|
||||||
Gbl.Form.Id,
|
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 *****/
|
/***** End of list and form *****/
|
||||||
|
|
|
@ -460,8 +460,6 @@ void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
||||||
"</script>",
|
"</script>",
|
||||||
IdFirstClickTime,(long) UsrFigures.FirstClickTimeUTC,
|
IdFirstClickTime,(long) UsrFigures.FirstClickTimeUTC,
|
||||||
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
(unsigned) Gbl.Prefs.DateFormat,Txt_Today);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else // First click time is unknown or user never logged
|
else // First click time is unknown or user never logged
|
||||||
/***** Button to fetch and store first click time *****/
|
/***** Button to fetch and store first click time *****/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user