TT#122029 As Subscriber/SubscriberAdmin, I want to see today as default date for all date selections based on QDate

Change-Id: Ie449b1fd20eb889c28cb92c7269e78d96a9da4f6
mr10.0
CORP\hzigha 4 years ago
parent 05a10d4ae5
commit b868415001

@ -37,7 +37,7 @@
</template>
<script>
import CscCfGroupCondition from 'components/call-forwarding/CscCfGroupCondition'
import { mapActions } from 'vuex'
import { mapActions, mapGetters } from 'vuex'
import { timeSetDateExact } from 'src/filters/time-set'
export default {
name: 'CscCfGroupConditionDate',
@ -72,11 +72,15 @@ export default {
}
},
computed: {
...mapGetters([
'getCurrentFormattedDateWithSlash'
]),
formattedDate () {
if (this.timeSet) {
return timeSetDateExact(this.timeSet.times)
} else {
return this.getCurrentFormattedDateWithSlash
}
return null
}
},
mounted () {

@ -2,7 +2,7 @@
<csc-input
:value="value"
v-bind="$attrs"
@click="$refs.popupTime.show()"
@click="loadFormattedDate(); $refs.popupTime.show()"
@input="$emit('input', $event)"
>
<template
@ -13,6 +13,7 @@
color="primary"
dense
flat
@click="loadFormattedDate();"
>
<q-popup-proxy
ref="popupTime"
@ -31,6 +32,7 @@
<script>
import CscInput from 'components/form/CscInput'
import { mapGetters } from 'vuex'
export default {
name: 'CscInputDate',
components: { CscInput },
@ -42,6 +44,19 @@ export default {
},
data () {
return {}
},
computed: {
...mapGetters([
'getCurrentFormattedDateWithDash'
])
},
methods: {
loadFormattedDate () {
const currentDate = this.getCurrentFormattedDateWithDash
if (!this.value) {
this.$emit('input', currentDate)
}
}
}
}
</script>

@ -29,6 +29,7 @@
<q-icon
name="event"
class="cursor-pointer"
@click="loadFormattedDateStart()"
>
<q-popup-proxy
transition-show="scale"
@ -93,6 +94,7 @@
<q-icon
name="event"
class="cursor-pointer"
@click="loadFormattedDateEnd()"
>
<q-popup-proxy
transition-show="scale"
@ -193,6 +195,7 @@
<script>
import _ from 'lodash'
import { mapGetters } from 'vuex'
export default {
name: 'CscCallRecordingFilters',
@ -212,6 +215,9 @@ export default {
}
},
computed: {
...mapGetters([
'getCurrentFormattedDateWithDashAndHour'
]),
filterType () {
return this.filterTypeModel && this.filterTypeModel.value
},
@ -299,6 +305,18 @@ export default {
this.typedFilter = null
this.dateStartFilter = null
this.dateEndFilter = null
},
loadFormattedDateStart () {
const currentDate = this.getCurrentFormattedDateWithDashAndHour
if (!this.dateStartFilter) {
this.dateStartFilter = currentDate
}
},
loadFormattedDateEnd () {
const currentDate = this.getCurrentFormattedDateWithDashAndHour
if (!this.dateEndFilter) {
this.dateEndFilter = currentDate
}
}
}
}

@ -0,0 +1,5 @@
export const INTERNAL_DATE_FORMAT_SLASH = 'YYYY/MM/DD'
export const INTERNAL_DATE_FORMAT_DASH = 'YYYY-MM-DD'
export const INTERNAL_DATE_FORMAT_DASH_HOUR = 'YYYY-MM-DD HH:mm'

@ -4,6 +4,7 @@ import {
i18n
} from 'src/boot/i18n'
import _ from 'lodash'
import { date } from 'quasar'
import CallBlockingModule from './call-blocking'
import CallForwardModule from './call-forward'
@ -34,6 +35,7 @@ import ConferenceModule from './conference'
import RtcEnginePlugin from 'src/plugins/rtc-engine'
import CallPlugin from 'src/plugins/call'
import ConferencePlugin from 'src/plugins/conference'
import { INTERNAL_DATE_FORMAT_SLASH, INTERNAL_DATE_FORMAT_DASH, INTERNAL_DATE_FORMAT_DASH_HOUR } from 'src/constants'
import {
getLanguageLabels
@ -116,6 +118,19 @@ export default function (/* { ssrContext } */) {
},
title () {
return i18n.t('CSC')
},
getCurrentFormattedDateWithDash () {
const currentDate = Date.now()
return date.formatDate(currentDate, INTERNAL_DATE_FORMAT_DASH)
},
getCurrentFormattedDateWithDashAndHour () {
const currentDate = new Date()
currentDate.setHours(0, 0, 0, 0)
return date.formatDate(currentDate, INTERNAL_DATE_FORMAT_DASH_HOUR)
},
getCurrentFormattedDateWithSlash () {
const currentDate = Date.now()
return date.formatDate(currentDate, INTERNAL_DATE_FORMAT_SLASH)
}
},
mutations: {

Loading…
Cancel
Save