Commit 5eb58808 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

add format time

parent 1ae90ea2
<template>
<span v-if="date">
{{ date.getMonth() + 1 }}/{{ date.getDate() }}/{{ date.getFullYear() }}
</span>
</template>
<script>
export default {
props: ['date']
}
</script>
<style>
</style>
...@@ -10,30 +10,44 @@ ...@@ -10,30 +10,44 @@
</v-card-text> </v-card-text>
<v-card-text class="white--text pt-0"> <v-card-text class="white--text pt-0">
Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet. Mauris cursus commodo interdum. Praesent ut Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet.
risus eget metus luctus accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a sit amet dui. Mauris cursus commodo interdum. Praesent ut risus eget metus luctus
Duis commodo vitae velit et faucibus. Morbi vehicula lacinia malesuada. Nulla placerat augue vel ipsum ultrices, accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a
cursus iaculis dui sollicitudin. Vestibulum eu ipsum vel diam elementum tempor vel ut orci. Orci varius natoque sit amet dui. Duis commodo vitae velit et faucibus. Morbi vehicula
penatibus et magnis dis parturient montes, nascetur ridiculus mus. lacinia malesuada. Nulla placerat augue vel ipsum ultrices, cursus
iaculis dui sollicitudin. Vestibulum eu ipsum vel diam elementum tempor
vel ut orci. Orci varius natoque penatibus et magnis dis parturient
montes, nascetur ridiculus mus.
</v-card-text> </v-card-text>
<v-divider></v-divider> <v-divider />
<div class="footer-bottom"> <div class="footer-bottom">
<div class="footer-bottom-left"> <div class="footer-bottom-left">
<figure class="payment"> <figure class="payment">
<img src="~/assets/images/payment.png" alt="payment" width="159" height="29"> <img
src="~/assets/images/payment.png"
alt="payment"
width="159"
height="29"
>
</figure> </figure>
</div> </div>
<p class="copyright">Riode eCommerce © 2022. All Rights Reserved</p> <p class="copyright">
Riode eCommerce © 2022. All Rights Reserved
</p>
<div class="footer-bottom-right"> <div class="footer-bottom-right">
<div class="social-link"> <div class="social-link">
<v-btn v-for="icon in icons" :key="icon" class="mx-4 white--text" icon> <v-btn
v-for="icon in icons"
:key="icon"
class="mx-4 white--text"
icon
>
<v-icon size="24px"> <v-icon size="24px">
{{ icon }} {{ icon }}
</v-icon> </v-icon>
</v-btn> </v-btn>
</div> </div>
</div> </div>
</div> </div>
...@@ -44,13 +58,8 @@ ...@@ -44,13 +58,8 @@
<script> <script>
export default { export default {
data: () => ({ data: () => ({
icons: [ icons: ['mdi-facebook', 'mdi-twitter', 'mdi-linkedin', 'mdi-instagram']
'mdi-facebook', })
'mdi-twitter',
'mdi-linkedin',
'mdi-instagram',
],
}),
} }
</script> </script>
...@@ -58,7 +67,6 @@ export default { ...@@ -58,7 +67,6 @@ export default {
.footer-bottom-left { .footer-bottom-left {
position: absolute; position: absolute;
left: 0; left: 0;
} }
.footer-bottom-right { .footer-bottom-right {
...@@ -67,12 +75,10 @@ export default { ...@@ -67,12 +75,10 @@ export default {
} }
.copyright { .copyright {
position: absolute; position: absolute;
left: 0; left: 0;
right: 0; right: 0;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
</style> </style>
\ No newline at end of file
...@@ -27,7 +27,10 @@ export default { ...@@ -27,7 +27,10 @@ export default {
], ],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: ['~/plugins/axios.js'], plugins: [
'~/plugins/axios.js',
'~/plugins/formatTime.js'
],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
components: true, components: true,
...@@ -46,7 +49,7 @@ export default { ...@@ -46,7 +49,7 @@ export default {
'@nuxtjs/axios', '@nuxtjs/axios',
'@nuxtjs/auth-next', '@nuxtjs/auth-next',
'@nuxtjs/toast', '@nuxtjs/toast',
'@pinia/nuxt', '@pinia/nuxt'
], ],
// Axios module configuration: https://go.nuxtjs.dev/config-axios // Axios module configuration: https://go.nuxtjs.dev/config-axios
...@@ -55,7 +58,7 @@ export default { ...@@ -55,7 +58,7 @@ export default {
baseURL: 'http://127.0.0.1:8000/api/', baseURL: 'http://127.0.0.1:8000/api/',
debug: false, debug: false,
proxyHeaders: true, proxyHeaders: true,
credentials: false, credentials: false
}, },
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify // Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
......
...@@ -133,15 +133,8 @@ ...@@ -133,15 +133,8 @@
/> />
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-file-input <v-img v-if="typeof eImage === 'string'" :src="eImage" />
v-model="eImage"
accept="image/*"
label="Image"
prepend-icon="mdi-camera"
readonly
/>
</v-col> </v-col>
<v-img v-if="typeof eImage === 'string'" :src="eImage" />
</v-row> </v-row>
</v-container> </v-container>
<small>*indicates required field</small> <small>*indicates required field</small>
...@@ -289,6 +282,12 @@ ...@@ -289,6 +282,12 @@
</v-dialog> </v-dialog>
</v-toolbar> </v-toolbar>
</template> </template>
<template #item.created_at="{ item }">
<span>{{ formatDate(item.created_at)}}</span>
</template>
<template #item.updated_at="{ item }">
<span>{{ formatDate(item.updated_at)}}</span>
</template>
<template #item.actions="{ item }"> <template #item.actions="{ item }">
<v-icon :id="item.id" small @click="dialog2 = true; editCategory(item)"> <v-icon :id="item.id" small @click="dialog2 = true; editCategory(item)">
mdi-pencil mdi-pencil
...@@ -310,6 +309,7 @@ ...@@ -310,6 +309,7 @@
</v-app> </v-app>
</template> </template>
<script> <script>
export default { export default {
layout: 'admin', layout: 'admin',
middleware: ['web'], middleware: ['web'],
...@@ -320,6 +320,7 @@ export default { ...@@ -320,6 +320,7 @@ export default {
ordering: '', ordering: '',
image: null, image: null,
error: '', error: '',
dialog: false,
dialog1: false, dialog1: false,
dialog2: false, dialog2: false,
dialog3: false, dialog3: false,
...@@ -327,17 +328,17 @@ export default { ...@@ -327,17 +328,17 @@ export default {
options: [], options: [],
headers: [ headers: [
{ {
text: 'Name', text: 'ID',
align: 'start', align: 'start',
sortable: false, value: 'id'
value: 'name'
}, },
{ text: 'ID', value: 'id' }, { text: 'Name', value: 'name' },
{ text: 'Odering', value: 'ordering' }, { text: 'Odering', value: 'ordering' },
// { text: 'parent', value: 'parent_id', sortable: false }, // { text: 'parent', value: 'parent_id', sortable: false },
{ text: 'Created', value: 'created_at' }, { text: 'Created', value: 'created_at' },
{ text: 'Updated', value: 'updated_at' }, { text: 'Updated', value: 'updated_at' },
{ text: 'Actions', value: 'actions', sortable: false } { text: 'Actions', value: 'actions', sortable: false },
{ text: 'index', value: 'index', sortable: false }
], ],
categories: [], categories: [],
eID: '', eID: '',
...@@ -562,6 +563,17 @@ export default { ...@@ -562,6 +563,17 @@ export default {
console.log(error) console.log(error)
} }
} }
// formatDate (date) {
// const d = new Date(date)
// let month = '' + (d.getMonth() + 1)
// let day = '' + d.getDate()
// const year = d.getFullYear()
// if (month.length < 2) { month = '0' + month }
// if (day.length < 2) { day = '0' + day }
// return [year, month, day].join('-')
// }
} }
} }
</script> </script>
...@@ -328,6 +328,7 @@ ...@@ -328,6 +328,7 @@
multiple multiple
/> />
</v-col> </v-col>
<!-- <v-img v-if="typeof eImage === 'string'" :src="eImages" /> -->
<v-col cols="12"> <v-col cols="12">
<v-btn <v-btn
class="mx-2" class="mx-2"
...@@ -763,6 +764,7 @@ export default { ...@@ -763,6 +764,7 @@ export default {
color: '', color: '',
size: '', size: '',
quantity: '', quantity: '',
dialog: false,
dialog1: false, dialog1: false,
dialog2: false, dialog2: false,
dialog3: false, dialog3: false,
......
import Vue from 'vue'
Vue.mixin({
methods: {
formatDate (date) {
const d = new Date(date)
let month = '' + (d.getMonth() + 1)
let day = '' + d.getDate()
const year = d.getFullYear()
if (month.length < 2) { month = '0' + month }
if (day.length < 2) { day = '0' + day }
return [year, month, day].join('-')
}
}
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment