
Compact / Desktop .EXE and Help File Planed for 07.03.2004 |
![]() 29.02.2004 NetDtPExplorer_src.zip ??? KB |
Desktop .EXE Demo List of supported CultureInfo’s on Desktop |
20040314.NetDtPExplorer.Desktop.zip 41 KB |
Compact .EXE Demo List of supported CultureInfo’s on Compact |
20040314.NetDtPExplorer.ARM.zip 60 KB |
Compact .EXE Demo (runs also on Desktop) Different DateTimePickers is 8 Languages |
20040302.DateTimePickerTest.zip 17 KB |
NetDtPExplorer with mj10777.DateTimePicker |
20040302.NetDtPExplorer.Help.zip 311 KB |


At first I was very happy at finding a C# Source for DateTimePicker, thus avoiding translating a VB Version
found shortly before.
Dates and the DateTimePicker have always interested me so I found looking into the source to be very interesting.
However this pleasure was short lived when I realised that:
- only English was supported
- the Control would only run correctly on Machines that supported the Month/Day/Year
Date-Format for Short Dates :
Canada-English
:
and of course UK, French, German etc.
- no Support for First Day of Week (Saturday, Sunday and Monday are possible)
- only one Character per Weekday supported, which you can see is sometimes needed :
Catalan
(Monday) :
4 Characters
Egypt
(Saturday) :
5 Characters
(not that Egypt is supported yet on Compact, but that is only a matter of time)
- no resizing for longer DayOfWeek or long "Today" Text in supported Culture : Russian with
French
Wrong :
Correct :
- no resizing for long Month Year in supported Culture :
Greek
Wrong :
Correct :
- no Font support
- no CustomFormat support (here : ddd, d MMMM yyyy 'r.')
- no Min/MaxDateTime support (Read only in Desktop) :
--> MinDateTime=2004-03-02 ; MaxDateTime=2004-03-29:
Comic Sans MS,9.75F,Bold :
with Tahoma,7,Bold :
- and of course no "Today" support
what can it do and what it cannot do ?
This means that for each Culture the proper Text must be supplied for the word "Today".
In so far as the Desktop Version shows the correct Text ( and many are not supported) this has build in with the proper Text. This of course only works where my Keyboard supports the characters used.
This is the case for Arabic, Cyrillic, Greek, Hebrew, Japanese (and most Asian) but also for Polish.
To solve this an Unicode coding must be done for the s_Today string:
if (ci_CultureInfo.Parent.ToString() == "ja") // Japanese (Japan) Japanese As far as I know there are 75 "Parent" Languages supported on Window-XP,
The default value is "Today", so if this shows on your Culture then this must be build in here.
Any information sent to me will built in and updated.
Note : Microsoft has reserved 13 strings in CultureInfo.DateTimeFormat.MonthNames[], all (134) of which
are empty.
2) There is no support for non date patterns like:
{
s_Today = new string(new char[] {(char)31169,(char)12398,(char)21517,
(char)21069,(char)12399,(char)12463,(char)12522,(char)12473,(char)12391,(char)12377,(char)12290});
}
with unknown Text (hopefully nothing nasty) :
Desktop :
all of which have been build into the Method DateTimePicker_CultureInfo.OnToday()
included in the mj10777.DateTimePicker.cs.
This would be a nice place to sneak in the "Today" string if they decided not to support
a CultureInfo.Today string (hint, hint).
As to why there are 13 Months in the year I don't know
- maybe some
non-Gregorian Calendar ?
- Postal Codes
- Administrative Regions (states, provinces, prefectures, etc)
- Phone numbers
- The way given names are presented (western style and Japan, China, etc) :
--> "Mark Johnson" and "JOHNSON Mark"
- Vehicle license plate numbers
These things could however be built into the DateTimePicker_CultureInfo and set in the Method OnToday()
- my old "i_Language" is being set there now
but as Keith Farmer noted this is "a rather messy problem"
- a lot of support would be needed from outside for this.
1) CultureInfo support :
- all DateFormats, Days of Week, Months of Year, First Day of Week are retieved from the CultureInfo
- Default is allways the CultureInfo retrieved from
--> System.Globalization.CultureInfo.CurrentCulture.Clone();
- dtp_MainFrame.Culture = new CultureInfo("something");
--> can be used to overide this value.
2) Font support :
- Default is allways "Frutiger Linotype",10F,Bold
--> if "Comic Sans MS" is not installed "Arial" will be used
4 Font Properties are supported :
- dtp_MainFrame.CalendarFont = : all Font-Properties below will be set !
- dtp_MainFrame.FontCaption = Font("Courier New",12,System.Drawing.FontStyle.Italic);
- dtp_MainFrame.FontDay = Font("Tahmoa",10,System.Drawing.FontStyle.Regular);
- dtp_MainFrame.FontToday = Font("Comic Sans MS",10,System.Drawing.FontStyle.Underline);
Checks are made to insure that the resulting Control will fit the Compact Screen (Width 240)
3) Color support :
- Default are the default Window values (in so far as it was supported)
--> =SystemColors.ActiveCaptionText; =System.Drawing.Color.LightSalmon; etc.
9 Color (for Brushes) Properties are supported :
- dtp_MainFrame.CalendarForeColor : Day-Color (activ Month, Arrows, Today)
- dtp_MainFrame.CalendarMonthBackround : Day-Background (activ Month, Arrow Box)
- dtp_MainFrame.CurInactiv : Day-Color (inactiv Month)
- dtp_MainFrame.RedActiv : Invalid Day-Color (activ Month)
- dtp_MainFrame.RedInactiv : Invalid Day-Color (inactiv Month)
- dtp_MainFrame.BackSelect : Selected Day-Background
- dtp_MainFrame.TextSelect : Selected Day-Text
- dtp_MainFrame.CalendarTitelBackColor : Caption-Background (Top portion of the Control)
- dtp_MainFrame.CalendarTitelForeColor : Caption-Text (Month / Year Text)
No checks are made to prevent eye damage:
4) Min/MaxDateTime support :
- Default are the DateTime values : DateTime.MinValue / DateTime.MaxValue;
- dtp_MainFrame.MinDateTime = new DateTime(2004,1,29);
- dtp_MainFrame.MaxDateTime = dtp_MainFrame.MinDateTime.AddDays(15);
The Dates between 2004-01-29 to 2004-02-13 may be selected
--> You may wonder why 2004-02-29 in the Eye-Killer is selected
and that would be a very good question indeed ... Corrected.
5) FirstDayOfWeek support :
- Default is the CultureInfo.DateTimeFormat.FirstDayOfWeek value;
- dtp_MainFrame.FirstDayOfWeek = (int)DayOfWeek.Wednesday;
The Control will show this value as First Day of Week (Saturday, Sunday and Monday are realistic)
--> You may wonder why this is supported, but I would prefer not to remember the claims I made in the past...
... lets say ... it makes the testing of the logic easier.
6) DayOfWeekC support (Amount of characters shown for the Weekdays):
- Default is 2
- dtp_MainFrame.DayOfWeekC = 55;
Checks are made to insure that the results will fit the Screen
--> the amount of Characters will be reduced until it fits or the longest found Weekday
--> the Desktop Version returns 10 (length of longest Weekday : "Donnerstag")
--> the Compact Version returns 7