further improvements to search view
This commit is contained in:
28
vue/src/components/LastCooked.vue
Normal file
28
vue/src/components/LastCooked.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<template>
|
||||
<span>
|
||||
<b-badge pill variant="primary" v-if="recipe.last_cooked !== null"><i class="fas fa-utensils"></i> {{
|
||||
formatDate(recipe.last_cooked)
|
||||
}}</b-badge>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import moment from "moment/moment";
|
||||
|
||||
export default {
|
||||
name: "LastCooked",
|
||||
props: {
|
||||
recipe: Object
|
||||
},
|
||||
methods: {
|
||||
formatDate: function (datetime) {
|
||||
moment.locale(window.navigator.language);
|
||||
return moment(datetime).format('L')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
Reference in New Issue
Block a user