Skip to content

Form Field with date format is handled incorrectly for different browsers. #15490

@AlexKay34

Description

@AlexKay34

Attach (recommended) or Link to PDF file here:
PDF mit Datum_edit.pdf

Configuration:

  • Web browser and its version: Chrome Version 105.0.5195.127 (Offizieller Build) (64-Bit) / Firefox 105.0 (64-Bit)
  • Operating system and its version: Windows 11 Pro 21H2 (German de-DE)
  • PDF.js version: v2.16.105
  • Is a browser extension: no
  • PDF is in en-EN, but same behaviour for de-DE (or de-AT, which was the original problem)

Steps to reproduce the problem in Chrome:

  1. Open attached PDF with PDFjs in Chrome
  2. Enter a date into a date field (e.g. field labeled "von") in the format "d.M.yyyy" (e.g. skipping the leading zero from 01.09.2022 -> 1.9.2022)
  3. Click out of the Field to lose focus
  4. Date is displayed in format "MM.dd.yyyy"

What is the expected behavior? (add screenshot)
Date is displayed in original format OR date is displayed in "dd.MM.yyyy" format OR an error is shown in the browser stating the format is invalid

Steps to reproduce the problem in Firefox:

  1. Open attached PDF with PDFjs in Firefox
  2. Enter a date into a date field (e.g. field labeled "von") in the format "d.M.yyyy"
  3. Click out of the Field to lose focus
  4. An Error is shown in the browser stating the format is invalid.

What is the expected behavior? (add screenshot)
Date is displayed in original format OR date is displayed in "dd.MM.yyyy" format OR an error is shown in the browser stating the format is invalid

What went wrong? (add screenshot)
As far as I can tell, the browsers support different date Formats when parsing a string to a date.
With chrome the date beeing swapped can easily be overlooked.
Entering "1.9.2022" in a date field and instead of the 1st of september you get the 9th of january can be fatal.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions