feat: DateConverter

Signed-off-by: CorentinTh <corentin.thomasset74@gmail.com>
This commit is contained in:
CorentinTh 2020-04-25 21:05:40 +02:00 committed by Corentin THOMASSET
parent d1db2c8601
commit 5a06d89bcc
7 changed files with 132 additions and 53 deletions

View file

@ -0,0 +1,64 @@
<template>
<v-row justify="center">
<v-col lg="6" md="6" sm="12" >
<v-card class="mb-5">
<v-card-title>Input</v-card-title>
<v-card-text>
<v-switch v-model="useCurrentDate" label="Use current date"/>
</v-card-text>
</v-card>
<v-card class="mb-5">
<v-card-title>Date</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Date" :value="displayedDate.toDateString()"/>
<v-text-field readonly outlined label="Locale date" :value="displayedDate.toLocaleDateString()"/>
</v-card-text>
</v-card>
<v-card class="mb-5">
<v-card-title>Time</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Time" :value="displayedDate.toTimeString()"/>
<v-text-field readonly outlined label="Locale time" :value="displayedDate.toLocaleTimeString()"/>
</v-card-text>
</v-card>
</v-col>
<v-col lg="6" md="6" sm="12">
<v-card >
<v-card-title>DateTime</v-card-title>
<v-card-text>
<v-text-field readonly outlined label="Locale datetime" :value="displayedDate.toLocaleString()"/>
<v-text-field readonly outlined label="ISO 8601" :value="displayedDate.toISOString()"/>
<v-text-field readonly outlined label="UTC format" :value="displayedDate.toUTCString()"/>
<v-text-field readonly outlined label="UNIX Timestamp (ms)" :value="displayedDate.getTime()"/>
<v-text-field readonly outlined label="Complete" :value="displayedDate.toString()"/>
</v-card-text>
</v-card>
</v-col>
</v-row>
</template>
<script>
export default {
name: "DateConverter",
created() {
setInterval(this.refreshCurrentDate.bind(this), 1000);
},
data() {
return {
useCurrentDate: true,
displayedDate: new Date(),
formats: ['locale'],
refreshCurrentDate() {
if (this.useCurrentDate) {
this.displayedDate = new Date();
}
}
}
}
}
</script>
<style scoped lang="less">
</style>

View file

@ -1,5 +1,5 @@
<template>
<v-card>
<v-card class="single-card">
<v-card-title>Hash text</v-card-title>
<v-card-text>
<v-textarea

View file

@ -1,34 +1,29 @@
<template>
<v-card>
<v-card class="single-card">
<v-card-title>Token generator</v-card-title>
<v-card-text>
<v-row no-gutters>
<v-col lg="6" md="12">
<v-switch v-model="withLowercase" label="Lowercase (abc...)" color="#4CAF50"/>
<v-switch v-model="withUppercase" label="Uppercase (ABC...)" color="#4CAF50"/>
<v-switch v-model="withLowercase" label="Lowercase (abc...)"/>
<v-switch v-model="withUppercase" label="Uppercase (ABC...)"/>
</v-col>
<v-col lg="6" md="12">
<v-switch v-model="withNumbers" label="Numbers (123...)" color="#4CAF50"/>
<v-switch v-model="withSpecials" label="Specials (#]-...)" color="#4CAF50"/>
<v-switch v-model="withNumbers" label="Numbers (123...)"/>
<v-switch v-model="withSpecials" label="Specials (#]-...)"/>
</v-col>
</v-row>
<v-slider :label="`Length (${length})`" v-model="length" color="#4CAF50"></v-slider>
<v-slider :label="`Length (${length})`" v-model="length" min="1" max="256"></v-slider>
<v-text-field
outlined
:value="token"
append-icon="fa-refresh"
@click:append="refreshToken()"
append-outer-icon="fa-clipboard"
@click:append-outer="copyToken()"
>
</v-text-field>
<v-textarea outlined v-model="token"></v-textarea>
<div class="text-center">
<v-btn @click="refreshToken()" depressed class="mr-4">Refresh</v-btn>
<v-btn @click="copyToken()" depressed>Copy token</v-btn>
</div>
</v-card-text>
</v-card>
</template>
@ -59,7 +54,7 @@
refreshToken() {
this.refreshBool = !this.refreshBool;
},
copyToken(){
copyToken() {
copyToClipboard(this.token);
this.$toast.success('Copied to clipboard.')
}
@ -82,9 +77,6 @@
}
</script>
<style>
.v-card {
max-width: 600px;
width: 500px;
}
<style >
</style>