Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show absolute dates when printing #3375

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/components/cards/badges/DueDate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<template>
<div v-if="card" class="duedate">
<transition name="zoom">
<div v-if="card.duedate" :class="dueIcon">
<div v-if="card.duedate" :class="dueIcon" :title="absoluteDate">
Copy link
Member Author

@weeman1337 weeman1337 Oct 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added the title attribute. There was a dueDateTooltip computed property before. But it wasn't be used. This now shows the absolute date when hovering.

<span>{{ relativeDate }}</span>
</div>
</transition>
Expand Down Expand Up @@ -62,14 +62,14 @@ export default {
}
return moment(this.card.duedate).fromNow()
},
dueDateTooltip() {
return moment(this.card.duedate).format('LLLL')
absoluteDate() {
return moment(this.card.duedate).format('L')
},
},
}
</script>

<style lang="scss" coped>
<style lang="scss" scoped>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo fixed

.icon.due {
background-position: 4px center;
border-radius: 3px;
Expand Down Expand Up @@ -105,11 +105,26 @@ export default {
padding: 3px 4px;
}

&::before,
span {
margin-left: 20px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
}

@media print {
.icon.due {
background-color: transparent !important;

span {
display: none;
}

&::before {
content: attr(title);
}
}
}
</style>