- Implemented register date for users
This commit is contained in:
@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS `user` (
|
|||||||
`mail` VARCHAR(255) NOT NULL,
|
`mail` VARCHAR(255) NOT NULL,
|
||||||
`avatar` VARCHAR(255),
|
`avatar` VARCHAR(255),
|
||||||
`gender` VARCHAR(255),
|
`gender` VARCHAR(255),
|
||||||
|
`register_date` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`password` VARCHAR(255) NOT NULL,
|
`password` VARCHAR(255) NOT NULL,
|
||||||
`role_id` INT UNSIGNED NOT NULL DEFAULT 1,
|
`role_id` INT UNSIGNED NOT NULL DEFAULT 1,
|
||||||
`verified` BOOLEAN DEFAULT false,
|
`verified` BOOLEAN DEFAULT false,
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ import clipboard from 'v-clipboard'
|
|||||||
Vue.use(clipboard)
|
Vue.use(clipboard)
|
||||||
|
|
||||||
// FUNCTIONS
|
// FUNCTIONS
|
||||||
var filter = function(text, length, clamp){
|
var filter = (text, length, clamp) => {
|
||||||
clamp = clamp || '...';
|
clamp = clamp || '...';
|
||||||
var node = document.createElement('div');
|
var node = document.createElement('div');
|
||||||
node.innerHTML = text;
|
node.innerHTML = text;
|
||||||
var content = node.textContent;
|
var content = node.textContent;
|
||||||
return content.length > length ? content.slice(0, length) + clamp : content;
|
return content.length > length ? content.slice(0, length) + clamp : content;
|
||||||
}
|
}
|
||||||
Vue.filter('truncate', filter)
|
Vue.filter('truncate', filter);
|
||||||
|
|
||||||
// Router
|
// Router
|
||||||
import router from './routes'
|
import router from './routes'
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
<i class="mad">check_circle</i>
|
<i class="mad">check_circle</i>
|
||||||
</span>
|
</span>
|
||||||
</h2>
|
</h2>
|
||||||
|
<span>Membre depuis le {{ registered_date }}</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -28,6 +29,17 @@ export default {
|
|||||||
computed: {
|
computed: {
|
||||||
user() {
|
user() {
|
||||||
return this.$store.getters.getUserProfile
|
return this.$store.getters.getUserProfile
|
||||||
|
},
|
||||||
|
registered_date() {
|
||||||
|
let raw_date = new Date(this.user.register_date);
|
||||||
|
|
||||||
|
let date_options = {
|
||||||
|
day: 'numeric',
|
||||||
|
month: 'long',
|
||||||
|
year: 'numeric',
|
||||||
|
};
|
||||||
|
|
||||||
|
return new Intl.DateTimeFormat("fr", date_options).format(raw_date);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user