From ba538c912f01fae91318ea0c295cc719c7cefa2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ca=C3=B1as=20Vargas?= Date: Mon, 18 Jan 2016 14:19:36 +0100 Subject: [PATCH] Version 15.118.4 --- js/{swad15.117.js => swad15.118.4.js} | 40 +++++++++++++++++---------- swad_changelog.h | 7 ++--- swad_profile.c | 5 ++-- 3 files changed, 31 insertions(+), 21 deletions(-) rename js/{swad15.117.js => swad15.118.4.js} (98%) diff --git a/js/swad15.117.js b/js/swad15.118.4.js similarity index 98% rename from js/swad15.117.js rename to js/swad15.118.4.js index 2eddc057d..3ccdd8968 100644 --- a/js/swad15.117.js +++ b/js/swad15.118.4.js @@ -40,8 +40,12 @@ var countClockConnected = 0; //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) { - var d = new Date; +function writeLocalDateFromUTC (id,TimeUTC,StrToday) { + var today = new Date(); + var todayYea = today.getFullYear(); + var todayMon = today.getMonth()+1; + var todayDay = today.getDate(); + var d = new Date(); var Yea; var Mon; var Day; @@ -54,7 +58,13 @@ function writeLocalDateFromUTC (id,TimeUTC) { Day = d.getDate(); StrMon = ((Mon < 10) ? '0' : '') + Mon; 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 **********************/ @@ -64,11 +74,11 @@ function writeLocalDateFromUTC (id,TimeUTC) { function writeLocalDateHMSFromUTC (id,TimeUTC,separator,StrToday) { // HMS: Hour, Minutes, Seconds - var today = new (Date); + var today = new Date(); var todayYea = today.getFullYear(); var todayMon = today.getMonth()+1; var todayDay = today.getDate(); - var d = new Date; + var d = new Date(); var Yea; var Mon; var Day; @@ -106,11 +116,11 @@ function writeLocalDateHMSFromUTC (id,TimeUTC,separator,StrToday) { function writeLocalDateHMFromUTC (id,TimeUTC,separator,StrToday) { // HM: Hour, Minutes - var today = new (Date); + var today = new Date(); var todayYea = today.getFullYear(); var todayMon = today.getMonth()+1; var todayDay = today.getDate(); - var d = new Date; + var d = new Date(); var Yea; var Mon; var Day; @@ -155,7 +165,7 @@ function setLocalDateTimeFormFromUTC (id,TimeUTC) { var YearIsValid = false; if (TimeUTC) { - d = new Date; + d = new Date(); d.setTime(TimeUTC * 1000); Year = d.getFullYear(); for (var i=0; i July 7 // December --> July ]; - var d = new Date; + var d = new Date(); d.setTime(TimeUTC * 1000); var CurrentMonth = d.getMonth() + 1; var CurrentYear = d.getFullYear(); @@ -915,7 +925,7 @@ function Cal_DrawCalendar (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod,PrintView, function DrawCurrentMonth (id,FirstDayOfWeek,TimeUTC,CurrentPlcCod, CGI,FormGoToCalendarParams,FormEventParams) { - var d = new Date; + var d = new Date(); d.setTime(TimeUTC * 1000); var Year = d.getFullYear(); var Month = d.getMonth() + 1; diff --git a/swad_changelog.h b/swad_changelog.h index e058bead5..3582b7f00 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -118,19 +118,18 @@ // TODO: Width of column for data in notifications is too short // TODO: Increment one second after each refresh in social timeline? -// TODO: Date-time without seconds in user's public profile. - /*****************************************************************************/ /****************************** 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 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: // 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.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; diff --git a/swad_profile.c b/swad_profile.c index 92d3124c1..42d4d3dea 100644 --- a/swad_profile.c +++ b/swad_profile.c @@ -317,6 +317,7 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) extern const char *Txt_From_TIME; extern const char *Txt_day; extern const char *Txt_days; + extern const char *Txt_Today; extern const char *Txt_Clicks; extern const char *Txt_clicks; extern const char *Txt_Downloads; @@ -406,9 +407,9 @@ static void Prf_ShowDetailsUserProfile (const struct UsrData *UsrDat) (UsrFigures.NumDays == 1) ? Txt_day : Txt_days); fprintf (Gbl.F.Out,"", - (long) UsrFigures.FirstClickTimeUTC); + (long) UsrFigures.FirstClickTimeUTC,Txt_Today); } else // First click time is unknown or user never logged /***** Button to fetch and store first click time *****/