Skip to content
Merged
Show file tree
Hide file tree
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
18 changes: 11 additions & 7 deletions apps/comments/src/components/Comment.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@
<div v-if="id && loading" class="comment_loading icon-loading-small" />

<!-- Relative time to the comment creation -->
<Moment v-else-if="creationDateTime" class="comment__timestamp" :timestamp="timestamp" />
<NcDateTime v-else-if="creationDateTime"
class="comment__timestamp"
:timestamp="timestamp"
:ignore-seconds="true" />
</div>

<!-- Message editor -->
Expand Down Expand Up @@ -112,17 +115,16 @@
<script>
import { getCurrentUser } from '@nextcloud/auth'
import { translate as t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'

import NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'
import NcActions from '@nextcloud/vue/dist/Components/NcActions.js'
import NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js'
import NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
import NcDateTime from '@nextcloud/vue/dist/Components/NcDateTime.js'
import RichEditorMixin from '@nextcloud/vue/dist/Mixins/richEditor.js'
import ArrowRight from 'vue-material-design-icons/ArrowRight.vue'

import Moment from './Moment.vue'
import CommentMixin from '../mixins/CommentMixin.js'

// Dynamic loading
Expand All @@ -132,13 +134,13 @@ export default {
name: 'Comment',

components: {
ArrowRight,
NcActionButton,
NcActions,
NcActionSeparator,
ArrowRight,
NcAvatar,
NcButton,
Moment,
NcDateTime,
NcRichContenteditable,
},
mixins: [RichEditorMixin, CommentMixin],
Expand Down Expand Up @@ -217,9 +219,11 @@ export default {
return !this.localMessage || this.localMessage.trim() === ''
},

/**
* Timestamp of the creation time (in ms UNIX time)
*/
timestamp() {
// seconds, not milliseconds
return parseInt(moment(this.creationDateTime).format('x'), 10) / 1000
return Date.parse(this.creationDateTime)
},
},

Expand Down
31 changes: 0 additions & 31 deletions apps/comments/src/components/Moment.vue

This file was deleted.

4 changes: 2 additions & 2 deletions dist/7255-7255.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/7255-7255.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/comments-comments-tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/comments-comments-tab.js.map

Large diffs are not rendered by default.