-
Notifications
You must be signed in to change notification settings - Fork 284
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
Timestamps on created and modified at values #3532
Timestamps on created and modified at values #3532
Conversation
src/components/card/CardSidebar.vue
Outdated
@@ -25,6 +25,7 @@ | |||
:active="tabId" | |||
:title="title" | |||
:subtitle="subtitle" | |||
:subtitleTooltip="subtitleTooltip" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind to fix the eslint warning?
src/components/card/CardSidebar.vue#L28
Attribute ':subtitleTooltip' must be hyphenated
Otherwise looks good, LGTM once linter is happy 👍 |
e119f75
to
25de24d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a big difference but I would prefer passing the timestamp directly to moment
instead of calculating the milliseconds and building a Date object.
What do you think?
src/components/card/CardSidebar.vue
Outdated
@@ -142,6 +146,9 @@ export default { | |||
subtitle() { | |||
return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000) | |||
}, | |||
subtitleTooltip() { | |||
return t('deck', 'Modified') + ': ' + this.formatDate(new Date(this.currentCard.lastModified * 1000)) + '\n' + t('deck', 'Created') + ': ' + this.formatDate(new Date(this.currentCard.createdAt * 1000)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return t('deck', 'Modified') + ': ' + this.formatDate(new Date(this.currentCard.lastModified * 1000)) + '\n' + t('deck', 'Created') + ': ' + this.formatDate(new Date(this.currentCard.createdAt * 1000)) | |
return t('deck', 'Modified') + ': ' + this.formatDate(this.currentCard.lastModified) + '\n' + t('deck', 'Created') + ': ' + this.formatDate(this.currentCard.createdAt) |
src/components/card/CardSidebar.vue
Outdated
formatDate(date) { | ||
return moment(date).locale(this.locale).format('LLLL') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatDate(date) { | |
return moment(date).locale(this.locale).format('LLLL') | |
formatDate(timestamp) { | |
return moment.unix(timestamp).locale(this.locale).format('LLLL') |
Signed-off-by: Luka Trovic <luka@nextcloud.com>
25de24d
to
054c5aa
Compare
Signed-off-by: Luka Trovic luka@nextcloud.com
Checklist