Exemple #1
0
        public void DatePickerSetSelectedDate_skSKCultureAndZeroSeconds_ShouldTrimSeconds()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("sk-Sk");

            DatePicker picker = new DatePicker();
            picker.SelectedDate = new DateTime(2010, 08, 29, 13, 12, 00);

            Assert.That(picker.TimePickerBox.Text, Is.EqualTo("13:12"));
        }
Exemple #2
0
        public void DatePickerSetSelectedDate_svSECulture_ShouldCorrectlyFormatDateAndTimePart()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("sv-SE");

            DatePicker picker = new DatePicker();
            picker.SelectedDate = new DateTime(2010, 08, 29, 13, 12, 33);

            Assert.That(picker.DatePickerBox.Text, Is.EqualTo("2010-08-29"));
            Assert.That(picker.TimePickerBox.Text, Is.EqualTo("13:12:33"));
        }
Exemple #3
0
        public void DatePickerSetSelectedDate_enUSCulture_ShouldCorrectlyFormatDateAndTimePart()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");

            DatePicker picker = new DatePicker();
            picker.SelectedDate = new DateTime(2010, 08, 29, 13, 12, 33);

            Assert.That(picker.DatePickerBox.Text, Is.EqualTo("8/29/2010"));
            Assert.That(picker.TimePickerBox.Text, Is.EqualTo("1:12:33 PM"));
        }
        public void DatePickerSetSelectedDate_skSkCulture_ShouldCorrectlyFormatDateAndTimePart()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("sk-Sk");

            DatePicker picker = new DatePicker();
            picker.SelectedDate = new DateTime(2010, 08, 29, 13, 12, 33);

            Assert.That(picker.DatePickerBox.Text, Is.EqualTo("29. 8. 2010")); // hmm, i get this on my Windows...
            Assert.That(picker.TimePickerBox.Text, Is.EqualTo("13:12:33"));
        }
		protected override Control AddEditor(Control container)
		{
			DatePicker picker = new DatePicker();
			picker.TimePickerBox.Visible = ShowTime;
			picker.DatePickerBox.Visible = ShowDate;
			picker.ID = Name;
            picker.DatePickerBox.Placeholder(GetLocalizedText("Placeholder") ?? Placeholder);
            picker.TimePickerBox.Placeholder(GetLocalizedText("TimePlaceholder") ?? TimePlaceholder);
			container.Controls.Add(picker);
			return picker;
		}
Exemple #6
0
        public void DatePickerSetSelectedDate_skSkCulture_ShouldCorrectlyFormatDateAndTimePart()
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("sk-Sk");

            DatePicker picker = new DatePicker();
            var date = new DateTime(2010, 08, 29, 13, 12, 33);
            picker.SelectedDate = date;

            Assert.That(picker.DatePickerBox.Text, Is.EqualTo(date.ToShortDateString()));
            Assert.That(picker.TimePickerBox.Text, Is.EqualTo(date.ToString("HH:mm:ss")));
        }
Exemple #7
0
 protected override Control AddEditor(Control container)
 {
     DatePicker picker = new DatePicker();
     picker.TimePickerBox.Visible = ShowTime;
     picker.DatePickerBox.Visible = ShowDate;
     picker.ID = Name;
     container.Controls.Add(picker);
     return picker;
 }