Thursday, November 02, 2006
EPS Date Drop Down class and international date formats
We are just about to release a new version of the Windows UI controls (2.0.x.x), which includes an enhanced version of the EPS date drop down control. (This control is our replacement for the default .NET date/time picker control... for more info on our control, see this post... note that in this latest version, we actually marked the .NET control as obsolete, since so many people used it by accident).
Anyway: This latest version of this control has the ability to parse German dates as well. For instance, "Mon 31.7.2006" is parsed correctly as the 31st of July 2006. (Note: It will also parse it correctly if an incorrect day is specified, such as "Sam 31.7.2006", since the 3-letter day information is ignored for parsing operations).
Note that this now happens completely automatically. The control also does not require a date format string anymore. In the past, the date format string was set to "ddd M/d/yyyy". This string (or the equivalent in each culture) is now assumed automatically. Therefore, the control should automatically work right in each particular culture. Note that if you do set the date format string to something else, you may have to worry about culture information yourself. For instance, if you set the string to "ddd MM/dd/yy" then you must make sure it is set to something appropriate in a different culture if that is of importance to you. If it is set to a simple format instruction on the other hand - such as "d" - then automatic formatting should still work.
The date drop down control has a whole bunch of international stuff built in on top of this. For instance, it respects settings such as the first day of the week (Sunday in the US, Monday in Europe for instance). It also uses local names for days and months and such. This has really been in this control all along, although I tweaked it a bit this time around to make that part more efficient.
Oh, and while I was at it, I also fixed a nasty data binding bug in this control (kinda along with a revamp of the databinding mechanism in Milos in general due to the move to 2.0... although this was slightly different).
Posted @ 11:35 AM by Egger, Markus (markus@code-magazine.com)
Post a Comment:
Comment Title (required):
Your Name (optional):
Your Email (optional):
Your Web Site (optional):
Your Comment (required):