Posted 12 May 2026, 2:52 am EST - Updated 12 May 2026, 2:58 am EST
Hi,
Migrate from 2010v1 to 2025v2 399 in ASP.NET WebForms NET Framework 4.8.1.
Using C1InputDate from C1.Web.Wijmo.Controls.48.dll
Changes C1DateInput to C1InputDate control.
Now those properties not appears: Text
My legacy code:
#region set date format parameter
DateTime d1 = new DateTime();
DateTime d2 = new DateTime();
if (Text1.Text.Length == 4)
{
d1 = Convert.ToDateTime("01/01/" + Text1.Text);
desde = d1.ToShortDateString();
}
else
{
d1 = Convert.ToDateTime(Text1.Text);
desde = C1CalDesde.SelectedDate.ToShortDateString();
}
d2 = DateTime.Now;
fecha = desde.Split('/');
any suggestions ?
Full code LEGACY:
#region set date format parameter
DateTime d1 = new DateTime();
DateTime d2 = new DateTime();
var value = Text1.Date;
if (Text1.Text.Length == 4)
{
d1 = Convert.ToDateTime("01/01/" + Text1.Text);
desde = d1.ToShortDateString();
}
else
{
d1 = Convert.ToDateTime(Text1.Text);
desde = C1CalDesde.SelectedDate.ToShortDateString();
}
d2 = DateTime.Now;
fecha = desde.Split('/');
day = fecha[0];
month = fecha[1];
year = fecha[2].Substring(0, 4);
desde = year + "/" + month + "/" + day + " 00:00";
dateA = day + "/" + month + "/" + year + " 00:00";
switch (txtTreeCols.Value)
{
case "TS1":
#region hourly
if (d1.ToShortDateString() == d2.ToShortDateString())
{
hasta = year + "/" + month + "/" + day + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + d2.Second;
queryDateHasta = day + "/" + month + "/" + year + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + d2.Second;
dateB = day + "/" + month + "/" + year + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + d2.Second;
dateNow = DateTime.Now.ToShortDateString();
}
else
{
hasta = year + "/" + month + "/" + day + " 23:59";
queryDateHasta = day + "/" + month + "/" + year + " 23:59";
dateB = day + "/" + month + "/" + year + " 23:59";
dateNow = DateTime.Now.ToShortDateString();
}
break;
#endregion
case "TS2":
#region monthly
if ((d1.Month == d2.Month) && (d1.Year == d2.Year))
{
hasta = year + "/" + month + "/" + String.Format("{0:00}", d2.Day) + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + String.Format("{0:00}", d2.Second);
queryDateHasta = month + "/" + year + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + d2.Second;
dateB = String.Format("{0:00}", d2.Day) + "/" + month + "/" + year + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + d2.Second;
}
else
{
desde = year + "/" + month + "/" + "01" + " 00:00:00";
hasta = d2.Year + "/" + month + "/" + getMonthDays((int.Parse(month) - 1), int.Parse(year)).ToString() + " 23:59";
queryDateHasta = month + "/" + year + " 23:59";
dateB = getMonthDays((int.Parse(month) - 1), int.Parse(year)).ToString() + "/" + month + "/" + year + " 23:59";
}
break;
#endregion
default:
#region annually
if (d1.Year == DateTime.Now.Year)
{
desde = year + "/01/01 00:00:00";
hasta = year + "/" + String.Format("{0:00}", d2.Month) + "/" + String.Format("{0:00}", d2.Day) + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + String.Format("{0:00}", d2.Second);
dateB = String.Format("{0:00}", d2.Day) + "/" + String.Format("{0:00}", d2.Month) + "/" + year + " " + String.Format("{0:00}", d2.Hour) + ":" + String.Format("{0:00}", d2.Minute) + ":" + String.Format("{0:00}", d2.Second);
}
else
{
desde = year + "/01/01 00:00:00";
hasta = d1.Year + "/12/31 23:59";
dateB = "31/12/" + year + " 23:59";
}
#endregion
break;
}
#endregion
