Repository: ant-design
Issue: Luxon DatePicker wrapper mixes timezones for different input interactions
Labels: help wanted,Inactive

### Reproduction link

[https://github.com/juanma-rodriguez-nazaries/antd-timepicker-luxon-timezone](https://github.com/juanma-rodriguez-nazaries/antd-timepicker-luxon-timezone)

### Steps to reproduce

1. Clone the repository
2. Run `pnpm install`
3. Run `pnpm run dev`
4. Open the browser and go to `http://localhost:5173/`
5. Open the console and check the logs
6. Try to change the first time input using the keyboard and press Tab to jump to the next input
7. Try to change the second time input using the mouse and select the time from the dropdown and press OK
8. Check the logs and see the difference in the timezone set (submit is optional)

### What is expected?

The goal is to have the TimePicker always set the timezone from the Luxon config, regardless of the input method.


### What is actually happening?

## Issue History
When using keyboard typing input on the Ant Design TimePicker, the timezone is set from locale time.
When using the mouse and selecting the time from the dropdown, the timezone is set from the Luxon config.

### **Update**
After updating the antd, rc-picker and luxon versions, the issue is still present, but it's reversed.
Now, when using keyboard typing input on the Ant Design TimePicker, the timezone is set from the Luxon config.
When using the mouse and selecting the time from the dropdown, the timezone is set from locale time.

| Environment | Info |
| --- | --- |
| antd | 5.22.1 |
| React | ^18.3.1 |
| System | Windows 11 |
| Browser | Chrome 131.0.6778.69 |

---
I've been trying to find a workaround for this closed issue: https://github.com/ant-design/ant-design/issues/51301
It's been suggested to use the `getNow: () => DateTime.now()` function as a workaround, but after testing it seems that the only workaround it's to redefine both the `getNow` and `parse` functions of the config to be able to have the same behavior on both interactions with the input.
I've been struggling with this input for a while because I need to compare the selected times and I get inconsistent behavior for the timezone when using the date values from a `react-hook-form`.
I think the config wrapper should keep track of the timezone properly in all scenarios for input values, which does not seem to be the case.

I am using a form to submit and validate the values to replicate my scenario, however, checking the `onChange` callbacks, even if forcing the DateTime instantiation with Luxon the issue is still present. Following the trace up to the `DatePicker.generatePicker` settings wrapper, I stepped on a workaround that might point towards a fix for this issue:

```typescript
const LuxonDatePicker = DatePicker.generatePicker<DateTime>({
    ...luxonGenerateConfig,
    // Uncomment to make both interactions work properly, if missing, only typing the time will work
    // getNow: () => DateTime.now(),
    locale: {
        ...luxonGenerateConfig.locale,
        parse: (locale: string, text: string, formats: string[]) => {
            console.log("parse", DateTime.fromFormat(text, formats[0], { locale }).toISO()); // This prints the settings timezone
            console.log("defaultParse", luxonGenerateConfig.locale.parse(locale, text, formats)?.toISO()); // This prints local timezone
            return DateTime.fromFormat(text, formats[0], { locale });
        },
    }
});
```
Please check this traces of my reproduction:
#### Logs sample
```
parse 2024-11-13T14:14:00.000-05:00
defaultParse 2024-11-13T14:14:00.000+01:00
onCalendarChange - Manual Type -  2024-11-13T14:14:00.000-05:00 America/New_York
OnChange - Manual Type -  2024-11-13T14:14:00.000-05:00 America/New_York
OnCalendarChange - UI Select -  2024-11-13T01:00:00.000+01:00 Europe/Madrid
OnCalendarChange - UI Select -  2024-11-13T01:04:00.000+01:00 Europe/Madrid
OnChange - UI Select -  2024-11-13T01:04:00.000+01:00 Europe/Madrid
```



Thank you.
Best regards,
JuanMa

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->