Quantcast
Channel: ASPNETWebStack Issue Tracker Rss Feed
Viewing all articles
Browse latest Browse all 7215

Commented Unassigned: date validation problem [1503]

$
0
0
I created a new MVC4 project in VS2012 with the basic template. I created a model class with a DateTime property. I added a default controller that sets the property to DateTime.Today and a default view that displays the editor for this property. I also included the jqueryval script bundle in my layout, they were in my project by default. When I run the project, there is a textbox with the value "2013.12.12. 0:00:00". But when I press submit, it says its invalid.
Comments: I personally don't agree with providing a bad default behavior if that's the easiest. I don't have any non-trivial suggestions, except adding a hard dependency on the globalized validators or not using the built-in validators at all. It is broken my default, even that link says that it shouldn't be used. American developers are being misled because they may think they have a working validator for their culture, when in fact they get a validation that is browser specific and may accept 30/30/2008, and non-Americans will just find that it doesn't work at all. If there is no default validation, it will raise the awareness of American and non-American developers alike to install a working validator library. And if there is a hard dependency, it could just work for everyone, given they are told how to include those scripts nicely. Sometimes I don't even recognize some packages that are added as dependencies, so I don't think it would be a big deal. But maybe the best would be if the jQuery validation package was bundled together with the globalization support, to me it seems to make little sense not to include it by default. Handling dates properly is a big deal in my opinion, and all the primitive type validations should just work by default, even if it meant adding a new dependency. Anyway, thanks for the info and feel free to close the issue, I understand if it may not be solved here and now. I hope it will be solved someday, and until that I'll make it work in my project by using the globalized validators.

Viewing all articles
Browse latest Browse all 7215

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>