PDA

View Full Version : [CLOSED] Date Time Type Month false value when given "Format"



opacjkt
Nov 06, 2015, 2:52 AM
.ascx file

when I added format="MMMM-yyyy" and Type ="Month" on datefield, why display value = {01/01/0001 00.00.00}


<ext:FormPanel ID="frmpnl" runat="server" Layout="FitLayout" AutoScroll="true">
<TopBar>
<ext:Toolbar runat="server" ID="topbrs">
<Items>
<ext:DateField runat="server" ID="dtDari" FieldLabel="Tanggal" Type="Month" Format="MMMM-yyyy" >
</ext:DateField>
<ext:ToolbarSeparator ID="ToolbarSeparator4" runat="server" />
<ext:Button runat="server" Icon="Accept" Text="Apply" ID="btnApply">
<DirectEvents>
<Click OnEvent="btnApplyOnClick">
<EventMask ShowMask="true" Msg="Execute......" />
</Click>
</DirectEvents>
</ext:Button>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
</Items>
</ext:FormPanel>


.cs file


protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
dtDari.Value = DateTime.Now;
}
}

protected void btnApplyOnClick(object sender, DirectEventArgs e)
{
DateTime dtx = DateTime.ParseExact(dtDari.Value.ToString(), "dd/MM/yyyy h:mm:ss", null);

}


why value dtDari.Value.ToString() is {01/01/0001 00.00.00}
how to fix it ?

thanks

Daniil
Nov 07, 2015, 8:12 AM
Hi @opacjkt,

Thank you for the report!

It is a known issue.
https://github.com/extnet/Ext.NET/issues/712

Unfortunately, not fixed.