Display "member since" on the left

This commit is contained in:
Pierre 2017-12-23 18:32:54 +01:00
parent 1c20807108
commit 322528a974
2 changed files with 30 additions and 1 deletions

View File

@ -83,4 +83,15 @@ ComunicWeb.common.date = {
return years + " years";
}
},
/**
* Get the difference of time from now to a specified
* timestamp and return it as a string
*
* @param {Integer} time The base time
* @return {String} Computed difference
*/
timeDiffToStr: function(time){
return this.diffToStr(this.time() - time);
},
}

View File

@ -83,7 +83,25 @@ ComunicWeb.pages.userPage.profileInfos = {
type: "a",
class: "pull-right",
innerHTML: infos.number_friends
})
});
//Add user account creation time
var accountCreationLi = createElem2({
appendTo: listInfos,
type: "li",
class: "list-group-item"
});
createElem2({
appendTo: accountCreationLi,
type: "b",
innerHTML: "Member since"
});
createElem2({
appendTo: accountCreationLi,
type: "a",
class: "pull-right",
innerHTML: ComunicWeb.common.date.timeDiffToStr(infos.account_creation_time),
});
//Add user status informations (if required)
if(signed_in()){