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