fix: Show tooltip for readable date

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-11-08 12:58:29 +01:00
parent 71cb08b00f
commit 51ac5db960
4 changed files with 43 additions and 5 deletions

View File

@@ -36,7 +36,7 @@
@remove="removeUserFromCard" /> @remove="removeUserFromCard" />
<DueDateSelector :card="card" <DueDateSelector :card="card"
:can-edit="canEdit && !saving" :can-edit="canEdit"
@change="updateCardDue" /> @change="updateCardDue" />
<div v-if="projectsEnabled" class="section-wrapper"> <div v-if="projectsEnabled" class="section-wrapper">

View File

@@ -92,6 +92,7 @@ import {
NcButton, NcButton,
NcDateTimePickerNative, NcDateTimePickerNative,
} from '@nextcloud/vue' } from '@nextcloud/vue'
import readableDate from '../../mixins/readableDate.js'
import { getDayNamesMin, getFirstDay, getMonthNamesShort } from '@nextcloud/l10n' import { getDayNamesMin, getFirstDay, getMonthNamesShort } from '@nextcloud/l10n'
import moment from '@nextcloud/moment' import moment from '@nextcloud/moment'
import ArchiveIcon from 'vue-material-design-icons/Archive.vue' import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
@@ -118,6 +119,9 @@ export default defineComponent({
NcActionSeparator, NcActionSeparator,
NcDateTimePickerNative, NcDateTimePickerNative,
}, },
mixins: [
readableDate,
],
props: { props: {
card: { card: {
type: Object, type: Object,
@@ -225,9 +229,6 @@ export default defineComponent({
archiveUnarchiveCard() { archiveUnarchiveCard() {
this.$store.dispatch('archiveUnarchiveCard', { ...this.card, archived: !this.card.archived }) this.$store.dispatch('archiveUnarchiveCard', { ...this.card, archived: !this.card.archived })
}, },
formatReadableDate(date) {
return moment(date).format('lll')
},
}, },
}) })
</script> </script>

View File

@@ -24,7 +24,7 @@
<div v-if="card" class="done"> <div v-if="card" class="done">
<transition name="zoom"> <transition name="zoom">
<div class="icon-check-circle"> <div class="icon-check-circle">
<CheckCircle :size="20" /> <CheckCircle :size="20" :title="formatReadableDate(card.done)" />
</div> </div>
</transition> </transition>
</div> </div>
@@ -32,12 +32,16 @@
<script> <script>
import CheckCircle from 'vue-material-design-icons/CheckCircle.vue' import CheckCircle from 'vue-material-design-icons/CheckCircle.vue'
import readableDate from '../../../mixins/readableDate.js'
export default { export default {
name: 'Done', name: 'Done',
components: { components: {
CheckCircle, CheckCircle,
}, },
mixins: [
readableDate,
],
props: { props: {
card: { card: {
type: Object, type: Object,

View File

@@ -0,0 +1,33 @@
/*
* @copyright Copyright (c) 2020 Julius Härtl <jus@bitgrid.net>
*
* @author Julius Härtl <jus@bitgrid.net>
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
import moment from '@nextcloud/moment'
export default {
computed: {
formatReadableDate() {
return (timestamp) => {
return moment(timestamp).format('lll')
}
},
},
}