I cannot get the the webDatePicker to work as we would like. I am replacing old text boxes that took the input as YYYYMMDD and passed that to the DB.
I need to retain that data input format so as not to disrupt the userbase but I want to allow the use of the calendar and also show the typed in date as dd-MMM-YYYY so it is very clear what they have selected.
My problem is that it is not working as expected and I get translated values of Na-NaN-0NaN after trying to edit and the input mask doesn't like yyyyMMdd.
What am I missing?
DisplayModeFormat = dd-MMM-yyyy
EditModeFormat = yyyyMMdd
I've tried playing with the DataMode property but that doesn't seem to help.
Input -> 20010305 -> tab away -> display 05-Mar-2010. Seems simple enough...
thanks
jack
Hi Jack,
The WebDateTimeEditor/DatePicker does not support pattern without separators between fields. It should be at least empty space.
It is not clear for me how display/edit pattern of WebDateTimeEditor can be related to format of data in DB. The Value on server is DateTime object. Well you may use Text property, but to exchange data with DB it does not look right to me. Also date pattern without separators can be confusign for end users.If you do use Text to exchange data between DB and WebDateTimeEditor, then I can suggest you to use "yyyy-MM-dd" or "yyyy MM dd" and remove/insert that separator on get/set
Viktor,
Thanks for the confirmation - the problem is that this is a legacy input screen and the company custom for data input of a date in string format has always been YYYYMMDD. The reason being that converting a date to a string in the reverse format allows numberical and number sorting.
The input for the database is a dynamic set of parameters so everything is passed as a string.
So the developer that put this page together originally used a string input instead of a date and put no conversion checking in so now the users are used to the input format. My problem is that bad dates are being sent to the DB.
I will have to deal with it or run the change by the users again. Maybe a popup calendar and some error checking.
Thanks
Please keep in mind, that WebDateTimeEditor/WebDatePicker does not support date fields without separators.