blazorbootstrap icon indicating copy to clipboard operation
blazorbootstrap copied to clipboard

Date Picker allows user to type invalid dates

Open kevon-vems opened this issue 1 year ago • 4 comments

Describe the bug Date Picker allows user to type invalid dates

To Reproduce Steps to reproduce the behavior:

  1. Go to https://demos.blazorbootstrap.com/form/date-input
  2. type invalid date into any DateInput field
  3. See date being wrong.

Expected behavior Date should not allow invalid numbers

Screenshots image

Versions (please complete the following information): Reproducible on your demo site

Sample code Your own site

GitHub repo blazorbootstrap

Desktop (please complete the following information): irrelevant

Smartphone (please complete the following information): irrelevant

Additional context reproducible on your own site

kevon-vems avatar Dec 10 '24 18:12 kevon-vems

@kevon-vems Thank you for using BlazorBootstrap. Assuming that your local date format is mm/dd/yyyy, that is why it is allowing 02/31/2025. What is your machine locale and date format?

gvreddy04 avatar Dec 11 '24 10:12 gvreddy04

@kevon-vems Please record the screen and share it. This will help us understand your issue better.

gvreddy04 avatar Dec 11 '24 10:12 gvreddy04

You're kidding right? Feb 31 does not exist. Feb has 28 days, and 29 days in a leap year.

The component should understand the concept that a month has anywhere between 28 and 31 days depending on the month and year

kevon-vems avatar Dec 11 '24 20:12 kevon-vems

@kevon-vems I didn't realize the month and day selected. This is the default behavior of <input type="date" />. I will check.

gvreddy04 avatar Dec 17 '24 15:12 gvreddy04