fix: added translation in Date pickers and fixed filter issue
This commit is contained in:
parent
0ab14ecf4e
commit
84a17652ee
@ -40,10 +40,12 @@
|
||||
class="text-sm"
|
||||
type="text"
|
||||
:value="value"
|
||||
@change="selectDate(getDate($event.target.value)) || togglePopover()"
|
||||
@change="
|
||||
selectDate(getDate($event.target.value)) || togglePopover()
|
||||
"
|
||||
/>
|
||||
<Button
|
||||
label="Today"
|
||||
:label="__('Today')"
|
||||
class="text-sm"
|
||||
@click="selectDate(getDate()) || togglePopover()"
|
||||
/>
|
||||
@ -57,7 +59,7 @@
|
||||
v-for="(d, i) in ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa']"
|
||||
:key="i"
|
||||
>
|
||||
{{ d }}
|
||||
{{ __(d) }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -83,13 +85,13 @@
|
||||
}
|
||||
"
|
||||
>
|
||||
{{ date.getDate() }}
|
||||
{{ __(date.getDate()) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-end p-1">
|
||||
<Button
|
||||
label="Clear"
|
||||
:label="__('Clear')"
|
||||
class="text-sm"
|
||||
@click="
|
||||
() => {
|
||||
@ -166,10 +168,12 @@ export default {
|
||||
},
|
||||
formatMonth() {
|
||||
let date = this.getDate(this.currentYear, this.currentMonth - 1, 1)
|
||||
return date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
})
|
||||
let month = __(
|
||||
date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
})
|
||||
)
|
||||
return `${month}, ${date.getFullYear()}`
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
v-for="(d, i) in ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa']"
|
||||
:key="i"
|
||||
>
|
||||
{{ d }}
|
||||
{{ __(d) }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -79,13 +79,13 @@
|
||||
</div>
|
||||
<div class="flex justify-end space-x-1 p-1">
|
||||
<Button
|
||||
label="Clear"
|
||||
:label="__('Clear')"
|
||||
@click="() => clearDates() | togglePopover()"
|
||||
:disabled="!fromDate || !toDate"
|
||||
/>
|
||||
<Button
|
||||
variant="solid"
|
||||
label="Apply"
|
||||
:label="__('Apply')"
|
||||
:disabled="!fromDate || !toDate"
|
||||
@click="() => selectDates() | togglePopover()"
|
||||
/>
|
||||
@ -161,10 +161,12 @@ export default {
|
||||
},
|
||||
formatMonth() {
|
||||
let date = this.getDate(this.currentYear, this.currentMonth - 1, 1)
|
||||
return date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
})
|
||||
let month = __(
|
||||
date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
})
|
||||
)
|
||||
return `${month}, ${date.getFullYear()}`
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
@change="updateDate($event.target.value) || togglePopover()"
|
||||
/>
|
||||
<Button
|
||||
label="Now"
|
||||
:label="__('Now')"
|
||||
class="text-sm"
|
||||
@click="selectDate(getDate(), false, true) || togglePopover()"
|
||||
/>
|
||||
@ -55,7 +55,7 @@
|
||||
v-for="(d, i) in ['su', 'mo', 'tu', 'we', 'th', 'fr', 'sa']"
|
||||
:key="i"
|
||||
>
|
||||
{{ d }}
|
||||
{{ __(d) }}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
@ -128,7 +128,7 @@
|
||||
</div>
|
||||
<div class="flex justify-end p-1">
|
||||
<Button
|
||||
label="Clear"
|
||||
:label="__('Clear')"
|
||||
class="text-sm"
|
||||
@click="
|
||||
() => {
|
||||
@ -208,10 +208,12 @@ export default {
|
||||
},
|
||||
formatMonth() {
|
||||
let date = this.getDate(this.currentYear, this.currentMonth - 1, 1)
|
||||
return date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
year: 'numeric',
|
||||
})
|
||||
let month = __(
|
||||
date.toLocaleString('en-US', {
|
||||
month: 'long',
|
||||
})
|
||||
)
|
||||
return `${month}, ${date.getFullYear()}`
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -331,9 +331,11 @@ function getValSelect(f) {
|
||||
} else if (typeNumber.includes(fieldtype)) {
|
||||
return h(FormControl, { type: 'number' })
|
||||
} else if (typeDate.includes(fieldtype) && operator == 'between') {
|
||||
return h(DateRangePicker)
|
||||
return h(DateRangePicker, { value: f.value })
|
||||
} else if (typeDate.includes(fieldtype)) {
|
||||
return h(fieldtype == 'Date' ? DatePicker : DatetimePicker)
|
||||
return h(fieldtype == 'Date' ? DatePicker : DatetimePicker, {
|
||||
value: f.value,
|
||||
})
|
||||
} else {
|
||||
return h(FormControl, { type: 'text' })
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user