invoiceninja / ui

Invoice Ninja: Web admin portal built with React
https://app.invoicing.co
Other
52 stars 45 forks source link

Add max="9999-12-31" to all date inputs to fix invalid year input #1745

Closed adrianaditech closed 1 month ago

adrianaditech commented 2 months ago

The current date inputs in the application allow entering invalid year. image

To fix this please set max="9999-12-31" attribute on all inputfields where type="date" then the user will be permitted to enter a valid date up to 9999-12-31 and cursor won't allow entry of 6 digit years.

turbo124 commented 2 months ago

@Civolilah is it possible to set max on date input?

adrianaditech commented 2 months ago

You just set <input type=“date” max=“9999-12-31”… and the browser automatically recognizes that and only allows 4 digit year entry

Civolilah commented 2 months ago

@Civolilah is it possible to set max on date input?

@turbo124 Yes, of course, we can set it to some realistic value. What do you think should be the maximum?

turbo124 commented 2 months ago

the suggest one here is fine 9999-12-31 as long as it does not impact the format that a user can add the date in, ie, localized date input format

Civolilah commented 2 months ago

the suggest one here is fine 9999-12-31 as long as it does not impact the format that a user can add the date in, ie, localized date input format

@turbo124 Okay, sure, it will be added as a maximum date.