diff options
| author | Shishkevich D. <135337715+shishkevichd@users.noreply.github.com> | 2025-03-17 14:26:07 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-17 14:26:07 +0300 |
| commit | db62a07fb89e08e974210ccb0f62cc648d799e94 (patch) | |
| tree | 50af3c5e77ae27c3e5b360eb32b9e95fe795aa25 /web/html/xui/component/persianDatepicker.html | |
| parent | e3120c402882e3fccc0112b1c0197126fb613329 (diff) | |
Code refactoring (#2785)
* chore: pretty theme menu in sidebar
* refactor: renaming component templates
* refactor: create custom `a-statistic` component
* fix: display button text only on large screens
* chore: remove loading background in overview page
* fix: show `Version` text when xray version is unknown
Diffstat (limited to 'web/html/xui/component/persianDatepicker.html')
| -rw-r--r-- | web/html/xui/component/persianDatepicker.html | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/web/html/xui/component/persianDatepicker.html b/web/html/xui/component/persianDatepicker.html deleted file mode 100644 index 2df79a06..00000000 --- a/web/html/xui/component/persianDatepicker.html +++ /dev/null @@ -1,72 +0,0 @@ -{{define "component/persianDatepickerTemplate"}} -<template> - <div> - <a-input :value="value" type="text" v-model="date" data-jdp class="persian-datepicker" - @input="$emit('input', convertToGregorian($event.target.value)); jalaliDatepicker.hide();" - :placeholder="placeholder"> - <template #addonAfter> - <a-icon type="calendar" style="font-size: 14px; opacity: 0.5;" /> - </template> - </a-input> - </div> -</template> -{{end}} - -{{define "component/persianDatepicker"}} -<link rel="stylesheet" href="{{ .base_path }}assets/persian-datepicker/persian-datepicker.min.css?{{ .cur_ver }}" /> -<script src="{{ .base_path }}assets/moment/moment-jalali.min.js?{{ .cur_ver }}"></script> -<script src="{{ .base_path }}assets/persian-datepicker/persian-datepicker.min.js?{{ .cur_ver }}"></script> -<script> - const persianDatepicker = {}; - - Vue.component('a-persian-datepicker', { - props: { - 'format': { - type: undefined, - required: false, - }, - 'value': { - type: String, - required: false, - }, - 'placeholder': { - type: String, - required: false, - }, - }, - template: `{{template "component/persianDatepickerTemplate"}}`, - data() { - return { - date: '', - persianDatepicker, - }; - }, - watch: { - value: function (date) { - this.date = this.convertToJalalian(date) - } - }, - mounted() { - this.date = this.convertToJalalian(this.value) - this.listenToDatepicker() - }, - methods: { - convertToGregorian(date) { - return date ? moment(moment(date, 'jYYYY/jMM/jDD HH:mm:ss').format('YYYY-MM-DD HH:mm:ss')) : null - }, - convertToJalalian(date) { - return date && moment.isMoment(date) ? date.format('jYYYY/jMM/jDD HH:mm:ss') : null - }, - listenToDatepicker() { - jalaliDatepicker.startWatch({ - time: true, - zIndex: '9999', - hideAfterChange: true, - useDropDownYears: false, - changeMonthRotateYear: true, - }); - }, - } - }); -</script> -{{end}}
\ No newline at end of file |
