diff options
-rw-r--r-- | .eslintrc.js | 3 | ||||
-rw-r--r-- | src/js/components/Create/CreateDateItem.vue | 2 | ||||
-rw-r--r-- | src/js/components/PollList/PollListItem.vue | 2 | ||||
-rw-r--r-- | src/js/components/SideBar/SideBarTabComments.vue | 1 | ||||
-rw-r--r-- | src/js/components/SideBar/SideBarTabDateOptions.vue | 1 | ||||
-rw-r--r-- | src/js/components/VoteTable/VoteHeader.vue | 2 | ||||
-rw-r--r-- | src/js/components/VoteTable/VoteTableHeader.vue | 1 | ||||
-rw-r--r-- | src/js/main.js | 5 | ||||
-rw-r--r-- | src/js/store/index.js | 2 | ||||
-rw-r--r-- | src/js/store/modules/event.js | 3 | ||||
-rw-r--r-- | src/js/store/modules/locale.js | 2 | ||||
-rw-r--r-- | src/js/store/modules/options.js | 1 |
12 files changed, 10 insertions, 15 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 13bf7142..1899e7dd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -12,7 +12,8 @@ module.exports = { OC: true, OCA: true, Vue: true, - VueRouter: true + VueRouter: true, + moment:true }, parserOptions: { parser: 'babel-eslint', diff --git a/src/js/components/Create/CreateDateItem.vue b/src/js/components/Create/CreateDateItem.vue index eaebe234..19c7b012 100644 --- a/src/js/components/Create/CreateDateItem.vue +++ b/src/js/components/Create/CreateDateItem.vue @@ -30,7 +30,6 @@ </template> <script> -import moment from 'moment' export default { name: 'DatePollItem', @@ -50,6 +49,7 @@ export default { default: undefined } } + } </script> diff --git a/src/js/components/PollList/PollListItem.vue b/src/js/components/PollList/PollListItem.vue index 95c0468a..f5495f3b 100644 --- a/src/js/components/PollList/PollListItem.vue +++ b/src/js/components/PollList/PollListItem.vue @@ -93,8 +93,6 @@ </template> <script> -import moment from 'moment' - export default { name: 'PollListItem', diff --git a/src/js/components/SideBar/SideBarTabComments.vue b/src/js/components/SideBar/SideBarTabComments.vue index 1d4c9fb4..8e6d4c82 100644 --- a/src/js/components/SideBar/SideBarTabComments.vue +++ b/src/js/components/SideBar/SideBarTabComments.vue @@ -45,7 +45,6 @@ </template> <script> -import moment from 'moment' import CommentAdd from './CommentAdd' import { mapState, mapGetters } from 'vuex' diff --git a/src/js/components/SideBar/SideBarTabDateOptions.vue b/src/js/components/SideBar/SideBarTabDateOptions.vue index c99b129b..0fa90320 100644 --- a/src/js/components/SideBar/SideBarTabDateOptions.vue +++ b/src/js/components/SideBar/SideBarTabDateOptions.vue @@ -61,7 +61,6 @@ <script> import { Multiselect } from '@nextcloud/vue' -import moment from 'moment' import { mapGetters, mapState } from 'vuex' import DatePollItem from '../Create/CreateDateItem' diff --git a/src/js/components/VoteTable/VoteHeader.vue b/src/js/components/VoteTable/VoteHeader.vue index 912390ab..49f97afc 100644 --- a/src/js/components/VoteTable/VoteHeader.vue +++ b/src/js/components/VoteTable/VoteHeader.vue @@ -25,7 +25,7 @@ <h2> {{ event.title }} <span v-if="expired" class="label error">{{ t('polls', 'Expired since %n', 1, timeSpanExpiration) }}</span> - <span v-if="!expired && isExpirationSet" class="label success">{{ t('polls', 'Place your votes until %n', 1, event.expire) }}</span> + <span v-if="!expired && isExpirationSet" class="label success">{{ t('polls', 'Place your votes until %n', 1, moment(event.expire).format('LLLL')) }}</span> <!-- <span v-if="!isExpirationSet" class="label success">{{ t('polls', 'No expiration date set') }}</span> --> <span v-if="event.deleted" class="label error">{{ t('polls', 'Deleted') }}</span> </h2> diff --git a/src/js/components/VoteTable/VoteTableHeader.vue b/src/js/components/VoteTable/VoteTableHeader.vue index 28634cb8..93941ae4 100644 --- a/src/js/components/VoteTable/VoteTableHeader.vue +++ b/src/js/components/VoteTable/VoteTableHeader.vue @@ -53,7 +53,6 @@ </template> <script> -import moment from 'moment' import { mapState, mapGetters } from 'vuex' export default { diff --git a/src/js/main.js b/src/js/main.js index 28877f5b..7fa2e6c6 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -29,6 +29,7 @@ import store from './store' import router from './router' import vClickOutside from 'v-click-outside' import VueClipboard from 'vue-clipboard2' +import moment from 'moment' import { PopoverMenu, Tooltip, DatetimePicker, AppContent } from '@nextcloud/vue' @@ -50,6 +51,10 @@ Vue.prototype.$http = axios Vue.prototype.OC = OC Vue.prototype.OCA = OCA +moment.locale(OC.getLocale()) + +Vue.prototype.moment = moment + Vue.component('PopoverMenu', PopoverMenu) Vue.component('AppContent', AppContent) Vue.component('DatePicker', DatetimePicker) diff --git a/src/js/store/index.js b/src/js/store/index.js index cdf31566..4f1a452a 100644 --- a/src/js/store/index.js +++ b/src/js/store/index.js @@ -31,7 +31,6 @@ import notification from './modules/notification' import votes from './modules/votes' import options from './modules/options' import shares from './modules/shares' -import locale from './modules/locale' Vue.use(Vuex) @@ -45,7 +44,6 @@ export default new Vuex.Store({ comments, event, notification, - locale, votes, options, shares diff --git a/src/js/store/modules/event.js b/src/js/store/modules/event.js index 30b46cdd..9538ab01 100644 --- a/src/js/store/modules/event.js +++ b/src/js/store/modules/event.js @@ -22,7 +22,6 @@ */ import axios from '@nextcloud/axios' -import moment from 'moment' const defaultEvent = () => { return { @@ -76,7 +75,7 @@ const getters = { }, timeSpanExpiration: (state, getters) => { - if (getters.expired) { + if (getters.expire) { return moment(state.expire).fromNow() } else { return t('polls', 'never') diff --git a/src/js/store/modules/locale.js b/src/js/store/modules/locale.js index 58f92146..b9086320 100644 --- a/src/js/store/modules/locale.js +++ b/src/js/store/modules/locale.js @@ -21,8 +21,6 @@ * */ -import moment from 'moment' - const getters = { longDateFormat() { return moment.localeData().longDateFormat('L') diff --git a/src/js/store/modules/options.js b/src/js/store/modules/options.js index be7b95c0..bf5f13f6 100644 --- a/src/js/store/modules/options.js +++ b/src/js/store/modules/options.js @@ -22,7 +22,6 @@ import axios from '@nextcloud/axios' import sortBy from 'lodash/sortBy' -import moment from 'moment' const defaultOptions = () => { return { |