[GH-ISSUE #5313] [Bug]: Missing clear/remove button (X) on expiry date picker when using Jalali calendar #3721

Closed
opened 2026-10-31 20:34:29 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @gholamshahivision-ops on GitHub (Jun 14, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5313

Describe the bug

When the panel's date and time setting is switched to Jalalian, the date picker modal used for a client's Expiry Date does not display a clear/remove button (x).

Once an expiry date is selected and saved for a client, it is impossible to remove or clear it while using the Jalali calendar framework. Switching the panel settings back to Gregorian restores the standard date picker, which correctly displays the clear button (x) allowing the date to be removed.

How to reproduce the problem

Steps to reproduce

  1. Go to Panel Settings.
  2. Change the Datepicker / Calendar setting to Jalalian.
  3. Go to the Clients list section in the sidebar.
  4. Click Add Client (or click the edit button on an existing client).
  5. Set an Expiry Date using the Jalali calendar and save it.
  6. Open the edit modal for that client again and try to remove or clear the selected expiry date—notice there is no cross (x) or clear button in the date field to wipe it out.

Expected behavior

The Jalalian date picker should match the functionality of the Gregorian picker. It should feature a clear/reset icon (x) inside the input field (or an allowClear property enabled on the component) so administrators can instantly remove an expiration date without switching global panel settings.

Actual behavior

When using the Jalalian calendar setting, the date picker input field becomes completely locked once a date is selected. There is no clear icon or reset button (x) inside the field. The only way to wipe the expiry date clean is to globally switch the entire panel back to the Gregorian calendar system.

Relevant logs


Screenshots

Image

3x-ui version

3.3.1

Xray-core version

No response

How did you install 3x-ui?

install.sh script

Operating system

Ubuntu 22

Which parts of the panel are affected?

Frontend (UI / panel pages)

Browser (only if it is a UI bug)

No response

Is the panel behind a reverse proxy or CDN?

Yes — Cloudflare (proxied DNS)

Before submitting

  • I searched existing issues and this bug has not been reported.
  • I am running the latest released version of 3x-ui (or have verified the bug still exists on it).
  • This bug report is written in English.
  • I have redacted any sensitive data (tokens, real domains, client UUIDs).
Originally created by @gholamshahivision-ops on GitHub (Jun 14, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/5313 ### Describe the bug When the panel's date and time setting is switched to **Jalalian**, the date picker modal used for a client's **Expiry Date** does not display a clear/remove button (`x`). Once an expiry date is selected and saved for a client, it is impossible to remove or clear it while using the Jalali calendar framework. Switching the panel settings back to **Gregorian** restores the standard date picker, which correctly displays the clear button (`x`) allowing the date to be removed. ### How to reproduce the problem ### Steps to reproduce 1. Go to **Panel Settings**. 2. Change the Datepicker / Calendar setting to **Jalalian**. 3. Go to the **Clients** list section in the sidebar. 4. Click **Add Client** (or click the edit button on an existing client). 5. Set an **Expiry Date** using the Jalali calendar and save it. 6. Open the edit modal for that client again and try to remove or clear the selected expiry date—notice there is no cross (`x`) or clear button in the date field to wipe it out. ### Expected behavior The Jalalian date picker should match the functionality of the Gregorian picker. It should feature a clear/reset icon (`x`) inside the input field (or an `allowClear` property enabled on the component) so administrators can instantly remove an expiration date without switching global panel settings. ### Actual behavior When using the **Jalalian** calendar setting, the date picker input field becomes completely locked once a date is selected. There is no clear icon or reset button (`x`) inside the field. The only way to wipe the expiry date clean is to globally switch the entire panel back to the Gregorian calendar system. ### Relevant logs ```shell ``` ### Screenshots <img width="1166" height="555" alt="Image" src="https://github.com/user-attachments/assets/932712c6-a58f-416e-aab4-bfcaadb20d9b" /> ### 3x-ui version 3.3.1 ### Xray-core version _No response_ ### How did you install 3x-ui? install.sh script ### Operating system Ubuntu 22 ### Which parts of the panel are affected? Frontend (UI / panel pages) ### Browser (only if it is a UI bug) _No response_ ### Is the panel behind a reverse proxy or CDN? Yes — Cloudflare (proxied DNS) ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this bug has not been reported. - [x] I am running the latest released version of 3x-ui (or have verified the bug still exists on it). - [x] This bug report is written in English. - [x] I have redacted any sensitive data (tokens, real domains, client UUIDs).
bsakaguchi 2026-10-31 20:34:29 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@github-actions[bot] commented on GitHub (Jun 14, 2026):

This is a confirmed bug in frontend/src/components/form/DateTimePicker.tsx.

The component has two rendering paths depending on the panel's calendar setting:

  • Gregorian: renders Ant Design's <DatePicker>, which ships with allowClear enabled by default. That produces the clear (×) icon in the input field.
  • Jalalian: renders <PersianDateTimePicker> from the persian-calendar-suite@^1.5.5 package (lines 64–84). The local type declaration in frontend/src/env.d.ts (lines 61–82) does not include an allowClear or equivalent prop, and the component is instantiated without one. The onChange handler is already written to handle null correctly (lines 70–71), so the callback side is fine — the only problem is that the library component renders no UI affordance to trigger it.

The result is exactly as described: once a date is saved under the Jalalian setting, there is no way to clear it from the picker UI without switching back to Gregorian.

Affected files and lines:

  • frontend/src/components/form/DateTimePicker.tsx, lines 64–84 (Jalalian branch)
  • frontend/src/env.d.ts, lines 61–82 (PersianDateTimePickerProps type declaration)

The DateTimePicker component is used for the client expiry date in ClientFormModal.tsx (line 523) and ClientBulkAddModal.tsx (line 338), and for the inbound expiry date in InboundFormModal.tsx (line 652), so all three locations are affected.

A fix would involve one of:

  1. Passing a clear-enabling prop to PersianDateTimePicker if the upstream library exposes one (the type declaration in env.d.ts would also need updating).
  2. Wrapping the PersianDateTimePicker with an explicit clear button inside the jdp-wrap container that calls onChange(null).

No version-specific information, logs, or additional steps are needed; the issue is fully reproducible from the source.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:4701324923 --> @github-actions[bot] commented on GitHub (Jun 14, 2026): This is a confirmed bug in `frontend/src/components/form/DateTimePicker.tsx`. The component has two rendering paths depending on the panel's calendar setting: - **Gregorian**: renders Ant Design's `<DatePicker>`, which ships with `allowClear` enabled by default. That produces the clear (×) icon in the input field. - **Jalalian**: renders `<PersianDateTimePicker>` from the `persian-calendar-suite@^1.5.5` package (lines 64–84). The local type declaration in `frontend/src/env.d.ts` (lines 61–82) does not include an `allowClear` or equivalent prop, and the component is instantiated without one. The `onChange` handler is already written to handle `null` correctly (lines 70–71), so the callback side is fine — the only problem is that the library component renders no UI affordance to trigger it. The result is exactly as described: once a date is saved under the Jalalian setting, there is no way to clear it from the picker UI without switching back to Gregorian. **Affected files and lines:** - `frontend/src/components/form/DateTimePicker.tsx`, lines 64–84 (Jalalian branch) - `frontend/src/env.d.ts`, lines 61–82 (`PersianDateTimePickerProps` type declaration) The `DateTimePicker` component is used for the client expiry date in `ClientFormModal.tsx` (line 523) and `ClientBulkAddModal.tsx` (line 338), and for the inbound expiry date in `InboundFormModal.tsx` (line 652), so all three locations are affected. A fix would involve one of: 1. Passing a clear-enabling prop to `PersianDateTimePicker` if the upstream library exposes one (the type declaration in `env.d.ts` would also need updating). 2. Wrapping the `PersianDateTimePicker` with an explicit clear button inside the `jdp-wrap` container that calls `onChange(null)`. No version-specific information, logs, or additional steps are needed; the issue is fully reproducible from the source. *This reply was generated automatically; a maintainer may follow up.*
Author
Owner

@MHSanaei commented on GitHub (Jun 15, 2026):

Fixed on main in f00512d1. The Jalali (Jalalian) expiry date picker now has a working clear (×) button, and the empty field no longer shows leftover Persian placeholder text. Ships in the next release.

<!-- gh-comment-id:4709488140 --> @MHSanaei commented on GitHub (Jun 15, 2026): Fixed on `main` in f00512d1. The Jalali (Jalalian) expiry date picker now has a working clear (×) button, and the empty field no longer shows leftover Persian placeholder text. Ships in the next release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MHSanaei/3x-ui#3721
No description provided.