showing when the account was created

This commit is contained in:
Jack 2020-10-31 02:47:08 +00:00
parent 65e6000adf
commit 04219f3d35
3 changed files with 17 additions and 0 deletions

View file

@ -2497,6 +2497,11 @@ key {
text-align: center;
}
&.createdDate {
text-align: center;
color: var(--sub-color);
}
&.history {
.loadMoreButton {
background: rgba(0, 0, 0, 0.1);

View file

@ -2851,6 +2851,7 @@
<div class="val">-</div>
</div>
</div>
<div class="group createdDate">asd</div>
<div class="group">
<div class="title">personal bests</div>
<div style="display: grid; grid-auto-flow: column; gap: 1rem">

View file

@ -268,6 +268,17 @@ firebase.auth().onAuthStateChanged(function (user) {
showFavouriteThemesAtTheTop();
let text = "Account created on " + user.metadata.creationTime;
const date1 = new Date(text);
const date2 = new Date();
const diffTime = Math.abs(date2 - date1);
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
text += ` (${diffDays} days ago)`;
$(".pageAccount .group.createdDate").text(text);
if (verifyUserWhenLoggedIn !== null) {
showNotification("Verifying", 1000);
verifyUserWhenLoggedIn.uid = user.uid;