surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.21k stars 815 forks source link

Validation message for min/max date on date question is unintuitive #4596

Closed asheq-svmx closed 2 years ago

asheq-svmx commented 2 years ago

Are you requesting a feature, reporting a bug or asking a question?

Bug

What is the current behavior?

When value for date question is out of bounds (based on min or max date), the validation message includes time and time zone info.

What is the expected behavior?

The validation message should NOT include time or time zone info. (This is for date questions, not datetime questions)

How would you reproduce the current behavior (if this is a bug)?

Use the following JSON, enter 2022-07-17 as answer to question, and try to submit form

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "text",
     "name": "question2",
     "inputType": "date",
     "min": "2022-07-18"
    }
   ]
  }
 ]
}

The following message is displayed: image

But it should say just The value should not be less than Sun Jul 18 2022 (with no information about time or timezone)

andrewtelnov commented 2 years ago

We should change the date display format for date and "date-locale" and do not use the standard function.

Thank you, Andrew

andrewtelnov commented 2 years ago

@asheq-svmx It is fixed by the PR above.

Thank you, Andrew SurveyJS Team If you like our products, please take a moment to share your experience with our company by contributing a short review for SurveyJS page at g2.com or at Trustpilot.com. As we’re building our business, every review helps build credibility for future customers and your feedback would be greatly appreciated.