custom-profile-fields: Fix handling manual date input.

This commit fixes the behavior when manually changing
the date input instead of selecting from the picker.

Changes done are-
- Users can enter date in various formats including the
one showed in the input like "June 20, 1999", "MM-DD-YYY",
and basically the formats which can be parsed by "Date".
- Fixed handling of invalid strings where we show
"Invalid date value" error message for some time without
sending the request to server.

Fixes #19936.
This commit is contained in:
Sahil Batra
2025-05-08 21:29:30 +05:30
committed by Tim Abbott
parent 0a684ab0f5
commit 926716d9f2
6 changed files with 182 additions and 42 deletions

View File

@@ -34,7 +34,7 @@ async function open_settings(page: Page): Promise<void> {
}
async function close_settings_and_date_picker(page: Page): Promise<void> {
const date_picker_selector = ".custom_user_field_value.datepicker.form-control";
const date_picker_selector = ".date-field-alt-input";
await page.click(date_picker_selector);
await page.waitForSelector(".flatpickr-calendar", {visible: true});