mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-03-01 01:20:49 +03:00
date format - jalalian
This commit is contained in:
parent
8018023187
commit
76fdfb2ef2
@ -128,7 +128,7 @@ Date.prototype.formatDateTime = function (split = ' ') {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class DateUtil {
|
class DateUtil {
|
||||||
// String string to date object
|
// String to date object
|
||||||
static parseDate(str) {
|
static parseDate(str) {
|
||||||
return new Date(str.replace(/-/g, '/'));
|
return new Date(str.replace(/-/g, '/'));
|
||||||
}
|
}
|
||||||
@ -143,4 +143,9 @@ class DateUtil {
|
|||||||
date.setMinTime();
|
date.setMinTime();
|
||||||
return date;
|
return date;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static convertToJalalian(date) {
|
||||||
|
return date && moment.isMoment(date) ? date.format('jYYYY/jMM/jDD HH:mm:ss') : null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -108,15 +108,16 @@
|
|||||||
format="YYYY-MM-DD HH:mm:ss" :dropdown-class-name="themeSwitcher.currentTheme"
|
format="YYYY-MM-DD HH:mm:ss" :dropdown-class-name="themeSwitcher.currentTheme"
|
||||||
v-model="clientsBulkModal.expiryTime"></a-date-picker>
|
v-model="clientsBulkModal.expiryTime"></a-date-picker>
|
||||||
<persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
|
<persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
|
||||||
value="clientsBulkModal.expiryTime" v-model="clientsBulkModal.expiryTime"></persian-datepicker>
|
value="clientsBulkModal.expiryTime" v-model="clientsBulkModal.expiryTime">
|
||||||
|
</persian-datepicker>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item v-if="clientsBulkModal.expiryTime != 0">
|
<a-form-item v-if="clientsBulkModal.expiryTime != 0">
|
||||||
<template slot="label">
|
<template slot="label">
|
||||||
<span>{{ i18n "pages.client.renew" }}</span>
|
|
||||||
<a-tooltip>
|
<a-tooltip>
|
||||||
<template slot="title">
|
<template slot="title">
|
||||||
<span>{{ i18n "pages.client.renewDesc" }}</span>
|
<span>{{ i18n "pages.client.renewDesc" }}</span>
|
||||||
</template>
|
</template>
|
||||||
|
{{ i18n "pages.client.renew" }}
|
||||||
<a-icon type="question-circle"></a-icon>
|
<a-icon type="question-circle"></a-icon>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
|
@ -54,12 +54,13 @@
|
|||||||
<a-icon type="question-circle"></a-icon>
|
<a-icon type="question-circle"></a-icon>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
</template>
|
</template>
|
||||||
<a-date-picker style="width: 100%;" v-if="datepicker == 'gregorian'" :show-time="{ format: 'HH:mm:ss' }" format="YYYY-MM-DD HH:mm:ss"
|
<a-date-picker style="width: 100%;" v-if="datepicker == 'gregorian'" :show-time="{ format: 'HH:mm:ss' }"
|
||||||
:dropdown-class-name="themeSwitcher.currentTheme"
|
format="YYYY-MM-DD HH:mm:ss" :dropdown-class-name="themeSwitcher.currentTheme"
|
||||||
v-model="dbInbound._expiryTime"></a-date-picker>
|
v-model="dbInbound._expiryTime"></a-date-picker>
|
||||||
<persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
|
<persian-datepicker v-else placeholder='{{ i18n "pages.settings.datepickerPlaceholder" }}'
|
||||||
value="dbInbound._expiryTime" v-model="dbInbound._expiryTime"></persian-datepicker>
|
value="dbInbound._expiryTime" v-model="dbInbound._expiryTime">
|
||||||
</a-form-item>
|
</persian-datepicker>
|
||||||
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
|
|
||||||
<!-- vmess settings -->
|
<!-- vmess settings -->
|
||||||
|
@ -90,7 +90,14 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>[[ DateUtil.formatMillis(client._expiryTime) ]]</span>
|
<span v-else>
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(client._expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(client._expiryTime)) ]]
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<table>
|
<table>
|
||||||
<tr class="tr-table-box">
|
<tr class="tr-table-box">
|
||||||
@ -108,7 +115,14 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>[[ DateUtil.formatMillis(client._expiryTime) ]]</span>
|
<span v-else>
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(client._expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(client._expiryTime)) ]]
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<a-tag style="min-width: 50px; border: none;" :color="userExpiryColor(app.expireDiff, client, themeSwitcher.isDarkTheme)"> [[ remainedDays(client.expiryTime) ]] </a-tag>
|
<a-tag style="min-width: 50px; border: none;" :color="userExpiryColor(app.expireDiff, client, themeSwitcher.isDarkTheme)"> [[ remainedDays(client.expiryTime) ]] </a-tag>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
@ -201,7 +215,14 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>[[ DateUtil.formatMillis(client._expiryTime) ]]</span>
|
<span v-else>
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(client._expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(client._expiryTime)) ]]
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<a-progress :show-info="false" :status="isClientEnabled(record, client.email)? 'exception' : ''" :percent="expireProgress(client.expiryTime, client.reset)" />
|
<a-progress :show-info="false" :status="isClientEnabled(record, client.email)? 'exception' : ''" :percent="expireProgress(client.expiryTime, client.reset)" />
|
||||||
</a-popover>
|
</a-popover>
|
||||||
@ -214,7 +235,14 @@
|
|||||||
<template slot="content">
|
<template slot="content">
|
||||||
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
<span v-if="client.expiryTime < 0">{{ i18n "pages.client.delayedStart" }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>[[ DateUtil.formatMillis(client._expiryTime) ]]</span>
|
<span v-else>
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(client._expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(client._expiryTime)) ]]
|
||||||
|
</template>
|
||||||
|
</span>
|
||||||
</template>
|
</template>
|
||||||
<a-tag style="min-width: 50px; border: none;" :color="userExpiryColor(app.expireDiff, client, themeSwitcher.isDarkTheme)"> [[ remainedDays(client.expiryTime) ]] </a-tag>
|
<a-tag style="min-width: 50px; border: none;" :color="userExpiryColor(app.expireDiff, client, themeSwitcher.isDarkTheme)"> [[ remainedDays(client.expiryTime) ]] </a-tag>
|
||||||
</a-popover>
|
</a-popover>
|
||||||
|
@ -221,7 +221,14 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<template v-if="infoModal.clientSettings.expiryTime > 0">
|
<template v-if="infoModal.clientSettings.expiryTime > 0">
|
||||||
<a-tag :color="usageColor(new Date().getTime(), app.expireDiff, infoModal.clientSettings.expiryTime)"> [[ DateUtil.formatMillis(infoModal.clientSettings.expiryTime) ]] </a-tag>
|
<a-tag :color="usageColor(new Date().getTime(), app.expireDiff, infoModal.clientSettings.expiryTime)">
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(infoModal.clientSettings.expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(infoModal.clientSettings.expiryTime)) ]]
|
||||||
|
</template>
|
||||||
|
</a-tag>
|
||||||
</template>
|
</template>
|
||||||
<a-tag v-else-if="infoModal.clientSettings.expiryTime < 0" color="green">[[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}
|
<a-tag v-else-if="infoModal.clientSettings.expiryTime < 0" color="green">[[ infoModal.clientSettings.expiryTime / -86400000 ]] {{ i18n "pages.client.days" }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
|
@ -403,9 +403,12 @@
|
|||||||
</template>
|
</template>
|
||||||
<template slot="expiryTime" slot-scope="text, dbInbound">
|
<template slot="expiryTime" slot-scope="text, dbInbound">
|
||||||
<a-popover v-if="dbInbound.expiryTime > 0" :overlay-class-name="themeSwitcher.currentTheme">
|
<a-popover v-if="dbInbound.expiryTime > 0" :overlay-class-name="themeSwitcher.currentTheme">
|
||||||
<template slot="content">
|
<template slot="content" v-if="app.datepicker === 'gregorian'">
|
||||||
[[ DateUtil.formatMillis(dbInbound.expiryTime) ]]
|
[[ DateUtil.formatMillis(dbInbound.expiryTime) ]]
|
||||||
</template>
|
</template>
|
||||||
|
<template v-else slot="content">
|
||||||
|
[[ DateUtil.convertToJalalian(moment(dbInbound.expiryTime)) ]]
|
||||||
|
</template>
|
||||||
<a-tag style="min-width: 50px;" :color="usageColor(new Date().getTime(), app.expireDiff, dbInbound._expiryTime)">
|
<a-tag style="min-width: 50px;" :color="usageColor(new Date().getTime(), app.expireDiff, dbInbound._expiryTime)">
|
||||||
[[ remainedDays(dbInbound._expiryTime) ]]
|
[[ remainedDays(dbInbound._expiryTime) ]]
|
||||||
</a-tag>
|
</a-tag>
|
||||||
@ -498,8 +501,14 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ i18n "pages.inbounds.expireDate" }}</td>
|
<td>{{ i18n "pages.inbounds.expireDate" }}</td>
|
||||||
<td>
|
<td>
|
||||||
<a-tag style="min-width: 50px; text-align: center;" v-if="dbInbound.expiryTime > 0" :color="dbInbound.isExpiry? 'red': 'blue'">
|
<a-tag style="min-width: 50px; text-align: center;" v-if="dbInbound.expiryTime > 0"
|
||||||
[[ DateUtil.formatMillis(dbInbound.expiryTime) ]]
|
:color="dbInbound.isExpiry? 'red': 'blue'">
|
||||||
|
<template v-if="app.datepicker === 'gregorian'">
|
||||||
|
[[ DateUtil.formatMillis(dbInbound.expiryTime) ]]
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
[[ DateUtil.convertToJalalian(moment(dbInbound.expiryTime)) ]]
|
||||||
|
</template>
|
||||||
</a-tag>
|
</a-tag>
|
||||||
<a-tag v-else style="text-align: center;" color="purple" class="infinite-tag">
|
<a-tag v-else style="text-align: center;" color="purple" class="infinite-tag">
|
||||||
<svg height="10px" width="14px" viewBox="0 0 640 512" fill="currentColor">
|
<svg height="10px" width="14px" viewBox="0 0 640 512" fill="currentColor">
|
||||||
|
Loading…
Reference in New Issue
Block a user