Browse Source

Added when the user first joined, using moment js

theflametrooper 8 years ago
parent
commit
38f3323953
2 changed files with 13 additions and 2 deletions
  1. 12 1
      frontend/components/User/Show.vue
  2. 1 1
      frontend/package.json

+ 12 - 1
frontend/components/User/Show.vue

@@ -4,6 +4,7 @@
 		<div class="container">
 			<img class="avatar" src="/assets/notes.png"/>
 			<h2 class="has-text-centered username">@{{user.username}}</h2>
+			<h5>A member since {{user.createdAt}}</h5>
 			<div class="admin-functionality" v-if="user.role == 'admin'">
 				<a class="button is-small is-info is-outlined" href='#' @click="changeRank('admin')" v-if="user.role == 'default'">Promote to Admin</a>
 				<a class="button is-small is-danger is-outlined" href='#' @click="changeRank('default')" v-else>Demote to User</a>
@@ -59,7 +60,11 @@
 				_this.socket = socket;
 				_this.socket.emit('users.findByUsername', _this.$route.params.username, res => {
 					if (res.status == 'error') this.$router.go('/404');
-					else _this.user = res.data; _this.isUser = true;
+					else {
+						_this.user = res.data;
+						this.user.createdAt = moment(this.user.createdAt).format('LL');
+						_this.isUser = true;
+					}
 				});
 			});
 		},
@@ -79,6 +84,12 @@
 		margin: auto;
 	}
 
+	h5 {
+		text-align: center;
+		margin-bottom: 25px;
+		font-size: 17px;
+	}
+
 	.level {
 		margin-top: 40px;
 	}

+ 1 - 1
frontend/package.json

@@ -28,7 +28,7 @@
     "vue-loader": "^8.5.2",
     "vue-style-loader": "^1.0.0",
     "whatwg-fetch": "^0.11.1",
-		"webpack": "^1.14.0",
+	"webpack": "^1.14.0",
     "webpack-dev-server": "^1.15.1"
   },
   "dependencies": {