From 50679c7c91aff06d04b8c662ec5dd8f30f7789f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6hrl?= Date: Tue, 12 May 2020 11:05:37 +0200 Subject: [PATCH] try to change calender format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Röhrl try to change calender format Signed-off-by: Jakob Röhrl --- src/components/card/CardSidebar.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 27531fd65..0dcaec879 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -104,6 +104,9 @@ @@ -203,6 +206,8 @@ import { formatFileSize } from '@nextcloud/files' import relativeDate from '../../mixins/relativeDate' import AttachmentList from './AttachmentList' import { generateUrl } from '@nextcloud/router' +import { getLocale } from '@nextcloud/l10n' +import moment from '@nextcloud/moment' const markdownIt = new MarkdownIt({ linkify: true, @@ -242,6 +247,7 @@ export default { addedLabelToCard: null, copiedCard: null, allLabels: null, + locale: getLocale(), saving: false, markdownIt: null, @@ -260,6 +266,10 @@ export default { hasActivity: capabilities && capabilities.activity, hasComments: !!OC.appswebroots['comments'], modalShow: false, + format: { + stringify: this.stringify, + parse: this.parse, + }, } }, computed: { @@ -485,6 +495,12 @@ export default { } this.$store.dispatch('removeLabel', data) }, + stringify(date) { + return moment(date).locale(this.locale).format('LLL') + }, + parse(value) { + return moment(value, 'LLL', this.locale).toDate() + }, }, }