Files
Umbraco-CMS/components/editorControls/SettingControls/Pickers/DateWithTime.cs

41 lines
1.0 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using umbraco.uicontrols.DatePicker;
using umbraco.cms.businesslogic.datatype;
namespace umbraco.editorControls.SettingControls.Pickers
{
public class DateWithTime : DataEditorSettingType
{
private DateTimePicker dp = new DateTimePicker();
private string _val = string.Empty;
public override string Value
{
get
{
return dp.DateTime.ToString();
}
set
{
if (!string.IsNullOrEmpty(value))
_val = value;
}
}
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
{
dp.ShowTime = true;
dp.ID = sender.GetName().Replace(" ", "_");
if (!string.IsNullOrEmpty(_val))
dp.DateTime = Convert.ToDateTime(_val);
return dp;
}
}
}