0

I have created a simple application build using asp.net MVC and SQL Server targeting the azure platform. My question is around date formatting. I have added a date picker which correctly uses dd/mm/yyy format. however when I pick the date I get the following validation error.

enter image description here

The project was build using database first. here is a screenshot of the property for that data item:

enter image description here

Where do I change the validation to accept dd/MM/yyyy. Also is there a way to set it so if there is a user in the US it will change date picker and validation to MM/dd/yyyy?

in both situations the date will be saved to the database as standard yyyy-MM-dd hh:mm:ss

3
  • 1
    Can you post your model Commented Oct 22, 2014 at 1:17
  • You haven't even told us which date picker plugin your using. Perhaps you could check its documentation Commented Oct 22, 2014 at 2:45
  • the problem is not dependent on the picker as it was happening when it was just a text field however in this case its Kendo UI Commented Oct 22, 2014 at 3:36

2 Answers 2

6

Burn this into your brain:

mm is minutes.

MM is months.

Sign up to request clarification or add additional context in comments.

Comments

0

The issue is clearly with your date format. You are entering dates in the format of dd/MM/yyyy while the system is expecting MM/dd/yyyy.

  1. Please check in your model whether you have specified any specific date formats.

  2. Change the Ui culture of Kendo

Like this

    <script>
         //set current to the "en-GB" culture script
         kendo.culture("en-GB");
    </script>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.