mirror of
https://github.com/acanas/swad-core.git
synced 2024-05-30 21:35:24 +02:00
Version 15.118.4
This commit is contained in:
parent
2b42cf4b38
commit
ba538c912f
|
@ -40,8 +40,12 @@ var countClockConnected = 0;
|
||||||
//id is the id of the HTML element in which date will be written
|
//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
|
//TimeUTC is the date-time to write in UTC UNIX time format
|
||||||
|
|
||||||
function writeLocalDateFromUTC (id,TimeUTC) {
|
function writeLocalDateFromUTC (id,TimeUTC,StrToday) {
|
||||||
var d = new Date;
|
var today = new Date();
|
||||||
|
var todayYea = today.getFullYear();
|
||||||
|
var todayMon = today.getMonth()+1;
|
||||||
|
var todayDay = today.getDate();
|
||||||
|
var d = new Date();
|
||||||
var Yea;
|
var Yea;
|
||||||
var Mon;
|
var Mon;
|
||||||
var Day;
|
var Day;
|
||||||
|
@ -54,7 +58,13 @@ function writeLocalDateFromUTC (id,TimeUTC) {
|
||||||
Day = d.getDate();
|
Day = d.getDate();
|
||||||
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
StrMon = ((Mon < 10) ? '0' : '') + Mon;
|
||||||
StrDay = ((Day < 10) ? '0' : '') + Day;
|
StrDay = ((Day < 10) ? '0' : '') + Day;
|
||||||
document.getElementById(id).innerHTML = Yea + '-' + StrMon + '-' + StrDay;
|
|
||||||
|
if (Yea == todayYea && Mon == todayMon && Day == todayDay && // Today
|
||||||
|
StrToday.length)
|
||||||
|
document.getElementById(id).innerHTML = StrToday;
|
||||||
|
else
|
||||||
|
document.getElementById(id).innerHTML = Yea + '-' + StrMon + '-' + StrDay;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************** Write a date-time in client local time **********************/
|
/*************** Write a date-time in client local time **********************/
|
||||||
|
@ -64,11 +74,11 @@ function writeLocalDateFromUTC (id,TimeUTC) {
|
||||||
|
|
||||||
function writeLocalDateHMSFromUTC (id,TimeUTC,separator,StrToday) {
|
function writeLocalDateHMSFromUTC (id,TimeUTC,separator,StrToday) {
|
||||||
// HMS: Hour, Minutes, Seconds
|
// HMS: Hour, Minutes, Seconds
|
||||||
var today = new (Date);
|
var today = new Date();
|
||||||
var todayYea = today.getFullYear();
|
var todayYea = today.getFullYear();
|
||||||
var todayMon = today.getMonth()+1;
|
var todayMon = today.getMonth()+1;
|
||||||
var todayDay = today.getDate();
|
var todayDay = today.getDate();
|
||||||
var d = new Date;
|
var d = new Date();
|
||||||
var Yea;
|
var Yea;
|
||||||
var Mon;
|
var Mon;
|
||||||
var Day;
|
var Day;
|
||||||
|
@ -106,11 +116,11 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,separator,StrToday) {
|
||||||
|
|
||||||
function writeLocalDateHMFromUTC (id,TimeUTC,separator,StrToday) {
|
function writeLocalDateHMFromUTC (id,TimeUTC,separator,StrToday) {
|
||||||
// HM: Hour, Minutes
|
// HM: Hour, Minutes
|
||||||
var today = new (Date);
|
var today = new Date();
|
||||||
var todayYea = today.getFullYear();
|
var todayYea = today.getFullYear();
|
||||||
var todayMon = today.getMonth()+1;
|
var todayMon = today.getMonth()+1;
|
||||||
var todayDay = today.getDate();
|
var todayDay = today.getDate();
|
||||||
var d = new Date;
|
var d = new Date();
|
||||||
var Yea;
|
var Yea;
|
||||||
var Mon;
|
var Mon;
|
||||||
var Day;
|
var Day;
|
||||||
|
@ -155,7 +165,7 @@ function setLocalDateTimeFormFromUTC (id,TimeUTC) {
|
||||||
var YearIsValid = false;
|
var YearIsValid = false;
|
||||||
|
|
||||||
if (TimeUTC) {
|
if (TimeUTC) {
|
||||||
d = new Date;
|
d = new Date();
|
||||||
d.setTime(TimeUTC * 1000);
|
d.setTime(TimeUTC * 1000);
|
||||||
Year = d.getFullYear();
|
Year = d.getFullYear();
|
||||||
for (var i=0; i<FormYea.options.length && !YearIsValid; i++)
|
for (var i=0; i<FormYea.options.length && !YearIsValid; i++)
|
||||||
|
@ -184,7 +194,7 @@ function setLocalDateTimeFormFromUTC (id,TimeUTC) {
|
||||||
|
|
||||||
// Set UTC time from local date-time form fields
|
// Set UTC time from local date-time form fields
|
||||||
function setUTCFromLocalDateTimeForm (id) {
|
function setUTCFromLocalDateTimeForm (id) {
|
||||||
var d = new (Date);
|
var d = new Date();
|
||||||
|
|
||||||
// Important: set year first in order to work properly with leap years
|
// Important: set year first in order to work properly with leap years
|
||||||
d.setFullYear(document.getElementById(id+'Year' ).value);
|
d.setFullYear(document.getElementById(id+'Year' ).value);
|
||||||
|
@ -202,7 +212,7 @@ function setUTCFromLocalDateTimeForm (id) {
|
||||||
// For example, if your time zone is GMT+2, -120 will be returned
|
// For example, if your time zone is GMT+2, -120 will be returned
|
||||||
function setTZ (id) {
|
function setTZ (id) {
|
||||||
var FormTZ = document.getElementById(id);
|
var FormTZ = document.getElementById(id);
|
||||||
var d = new (Date);
|
var d = new Date();
|
||||||
|
|
||||||
FormTZ.value = d.getTimezoneOffset();
|
FormTZ.value = d.getTimezoneOffset();
|
||||||
}
|
}
|
||||||
|
@ -245,7 +255,7 @@ function adjustDateForm (id) {
|
||||||
|
|
||||||
// Set a date range form to yesterday
|
// Set a date range form to yesterday
|
||||||
function setDateToYesterday () {
|
function setDateToYesterday () {
|
||||||
var d = new (Date);
|
var d = new Date();
|
||||||
|
|
||||||
d.setTime (d.getTime () - 24*60*60*1000); // Today - 1 day
|
d.setTime (d.getTime () - 24*60*60*1000); // Today - 1 day
|
||||||
setDateRange(d);
|
setDateRange(d);
|
||||||
|
@ -253,7 +263,7 @@ function setDateToYesterday () {
|
||||||
|
|
||||||
// Set a date range form to today
|
// Set a date range form to today
|
||||||
function setDateToToday () {
|
function setDateToToday () {
|
||||||
var d = new (Date);
|
var d = new Date();
|
||||||
|
|
||||||
setDateRange(d);
|
setDateRange(d);
|
||||||
}
|
}
|
||||||
|
@ -303,7 +313,7 @@ function writeLocalClock () {
|
||||||
|
|
||||||
setTimeout('writeLocalClock()',60000);
|
setTimeout('writeLocalClock()',60000);
|
||||||
|
|
||||||
d = new Date;
|
d = new Date();
|
||||||
d.setTime(secondsSince1970UTC * 1000);
|
d.setTime(secondsSince1970UTC * 1000);
|
||||||
secondsSince1970UTC += 60; // For next call
|
secondsSince1970UTC += 60; // For next call
|
||||||
|
|
||||||
|
@ -866,7 +876,7 @@ function Cal_DrawCalendar (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod,PrintView,
|
||||||
7, // November --> July
|
7, // November --> July
|
||||||
7 // December --> July
|
7 // December --> July
|
||||||
];
|
];
|
||||||
var d = new Date;
|
var d = new Date();
|
||||||
d.setTime(TimeUTC * 1000);
|
d.setTime(TimeUTC * 1000);
|
||||||
var CurrentMonth = d.getMonth() + 1;
|
var CurrentMonth = d.getMonth() + 1;
|
||||||
var CurrentYear = d.getFullYear();
|
var CurrentYear = d.getFullYear();
|
||||||
|
@ -915,7 +925,7 @@ function Cal_DrawCalendar (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod,PrintView,
|
||||||
|
|
||||||
function DrawCurrentMonth (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod,
|
function DrawCurrentMonth (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod,
|
||||||
CGI,FormGoToCalendarParams,FormEventParams) {
|
CGI,FormGoToCalendarParams,FormEventParams) {
|
||||||
var d = new Date;
|
var d = new Date();
|
||||||
d.setTime(TimeUTC * 1000);
|
d.setTime(TimeUTC * 1000);
|
||||||
var Year = d.getFullYear();
|
var Year = d.getFullYear();
|
||||||
var Month = d.getMonth() + 1;
|
var Month = d.getMonth() + 1;
|
|
@ -118,19 +118,18 @@
|
||||||
// TODO: Width of column for data in notifications is too short
|
// TODO: Width of column for data in notifications is too short
|
||||||
// TODO: Increment one second after each refresh in social timeline?
|
// TODO: Increment one second after each refresh in social timeline?
|
||||||
|
|
||||||
// TODO: Date-time without seconds in user's public profile.
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/****************************** Public constants *****************************/
|
/****************************** Public constants *****************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#define Log_PLATFORM_VERSION "SWAD 15.118.3 (2016-01-18)"
|
#define Log_PLATFORM_VERSION "SWAD 15.118.4 (2016-01-18)"
|
||||||
#define CSS_FILE "swad15.117.css"
|
#define CSS_FILE "swad15.117.css"
|
||||||
#define JS_FILE "swad15.117.js"
|
#define JS_FILE "swad15.118.4.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 15.118.4: Jan 18, 2016 Date-time without seconds in user's public profile. (192984 lines)
|
||||||
Version 15.118.3: Jan 18, 2016 Fixed bug in date-time of files in file-browsers. (192975 lines)
|
Version 15.118.3: Jan 18, 2016 Fixed bug in date-time of files in file-browsers. (192975 lines)
|
||||||
Version 15.118.2: Jan 18, 2016 Fixed bug in social_timelines table. (192973 lines)
|
Version 15.118.2: Jan 18, 2016 Fixed bug in social_timelines table. (192973 lines)
|
||||||
ALTER TABLE sessions CHANGE SessionId SessionId CHAR(43) COLLATE latin1_spanish_ci NOT NULL;
|
ALTER TABLE sessions CHANGE SessionId SessionId CHAR(43) COLLATE latin1_spanish_ci NOT NULL;
|
||||||
|
|
|
@ -317,6 +317,7 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
||||||
extern const char *Txt_From_TIME;
|
extern const char *Txt_From_TIME;
|
||||||
extern const char *Txt_day;
|
extern const char *Txt_day;
|
||||||
extern const char *Txt_days;
|
extern const char *Txt_days;
|
||||||
|
extern const char *Txt_Today;
|
||||||
extern const char *Txt_Clicks;
|
extern const char *Txt_Clicks;
|
||||||
extern const char *Txt_clicks;
|
extern const char *Txt_clicks;
|
||||||
extern const char *Txt_Downloads;
|
extern const char *Txt_Downloads;
|
||||||
|
@ -406,9 +407,9 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat)
|
||||||
(UsrFigures.NumDays == 1) ? Txt_day :
|
(UsrFigures.NumDays == 1) ? Txt_day :
|
||||||
Txt_days);
|
Txt_days);
|
||||||
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
fprintf (Gbl.F.Out,"<script type=\"text/javascript\">"
|
||||||
"writeLocalDateHMSFromUTC('first_click_date',%ld,' ');"
|
"writeLocalDateFromUTC('first_click_date',%ld,'%s');"
|
||||||
"</script>",
|
"</script>",
|
||||||
(long) UsrFigures.FirstClickTimeUTC);
|
(long) UsrFigures.FirstClickTimeUTC,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