Skip to content

Commit

Permalink
fix: Show tooltip for readable date
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr committed Nov 8, 2023
1 parent 71cb08b commit 51ac5db
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/card/CardSidebarTabDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
@remove="removeUserFromCard" />

<DueDateSelector :card="card"
:can-edit="canEdit && !saving"
:can-edit="canEdit"
@change="updateCardDue" />

<div v-if="projectsEnabled" class="section-wrapper">
Expand Down
7 changes: 4 additions & 3 deletions src/components/card/DueDateSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ import {
NcButton,
NcDateTimePickerNative,
} from '@nextcloud/vue'
import readableDate from '../../mixins/readableDate.js'
import { getDayNamesMin, getFirstDay, getMonthNamesShort } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import ArchiveIcon from 'vue-material-design-icons/Archive.vue'
Expand All @@ -118,6 +119,9 @@ export default defineComponent({
NcActionSeparator,
NcDateTimePickerNative,
},
mixins: [
readableDate,
],
props: {
card: {
type: Object,
Expand Down Expand Up @@ -225,9 +229,6 @@ export default defineComponent({
archiveUnarchiveCard() {
this.$store.dispatch('archiveUnarchiveCard', { ...this.card, archived: !this.card.archived })
},
formatReadableDate(date) {
return moment(date).format('lll')
},
},
})
</script>
Expand Down
6 changes: 5 additions & 1 deletion src/components/cards/badges/Done.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,24 @@
<div v-if="card" class="done">
<transition name="zoom">
<div class="icon-check-circle">
<CheckCircle :size="20" />
<CheckCircle :size="20" :title="formatReadableDate(card.done)" />
</div>
</transition>
</div>
</template>

<script>
import CheckCircle from 'vue-material-design-icons/CheckCircle.vue'
import readableDate from '../../../mixins/readableDate.js'
export default {
name: 'Done',
components: {
CheckCircle,
},
mixins: [
readableDate,
],
props: {
card: {
type: Object,
Expand Down
33 changes: 33 additions & 0 deletions src/mixins/readableDate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* @copyright Copyright (c) 2020 Julius Härtl <[email protected]>
*
* @author Julius Härtl <[email protected]>
*
* @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')
}
},
},
}

0 comments on commit 51ac5db

Please sign in to comment.