Skip to content

Commit

Permalink
Fix "Typing in date input ends early"
Browse files Browse the repository at this point in the history
Trying to type in a date in for example the start date table filter
is not working. The input is interpreted as a date
immediately. For example, typing "1" will result in
"01/01/2025", even if you wanted to type something
completely different.

This patch fixes that by enabling strict parsing. Arguably
not the best solution, but it works for now.
  • Loading branch information
Arnei committed Jan 23, 2025
1 parent b7ececd commit 4b6b67d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ const EventDetailsSchedulingTab = ({
className="datepicker-custom-input"
portalId="root"
locale={currentLanguage?.dateLocale}
strictParsing
/>
) : (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ const Schedule = <T extends {
className="datepicker-custom-input"
portalId="root"
locale={currentLanguage?.dateLocale}
strictParsing
/>
</td>
</tr>
Expand Down Expand Up @@ -459,6 +460,7 @@ const Schedule = <T extends {
className="datepicker-custom-input"
portalId="root"
locale={currentLanguage?.dateLocale}
strictParsing
/>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/TableFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ const FilterSwitch = ({
popperClassName="datepicker-custom"
className="datepicker-custom-input"
locale={getCurrentLanguageInformation()?.dateLocale}

strictParsing
/>
</div>
);
Expand Down
2 changes: 2 additions & 0 deletions src/components/shared/wizard/RenderField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ const EditableDateValue = ({
className="datepicker-custom-input"
wrapperClassName="datepicker-custom-wrapper"
locale={getCurrentLanguageInformation()?.dateLocale}
strictParsing
/>
</div>
) : (
Expand Down Expand Up @@ -399,6 +400,7 @@ const EditableSingleValueTime = ({
className="datepicker-custom-input"
wrapperClassName="datepicker-custom-wrapper"
locale={getCurrentLanguageInformation()?.dateLocale}
strictParsing
/>
</div>
) : (
Expand Down

0 comments on commit 4b6b67d

Please sign in to comment.