public static MyDate Parse(string S) { MyDate MD; // Huge assumptions time // * we will have up to 3 elements, split by spaces // * they will be in order date, month, year // * If two, they will be month, year // * If one, it will be year char[] delimiterChars = { ' ' }; string[] words = S.Split(delimiterChars); if (words.Length >= 3) { MD = new MyDate(words[2], words[1], words[0]); } else if (words.Length >= 2) { MD = new MyDate(words[1], words[0], ""); } else if (words.Length >= 1) { MD = new MyDate(words[0], "", ""); } else { MD = MinValue; } return(MD); }
static public MyDate ParseDate(XmlNode Node) { foreach (XmlNode Child in Node.ChildNodes) { if (Child.Name.ToUpper() == "DATE") { try { return(MyDate.Parse(Child.InnerText)); } catch (Exception) { return(MyDate.MinValue); } } } return(MyDate.MinValue); }
public MyDatePicker() { InitializeComponent(); pDate = new MyDate(DateTime.MinValue); }
private void calPick_DateChanged(object sender, DateRangeEventArgs e) { MyDate D = new MyDate(calPick.SelectionStart); this.Date = D; }