Jun 25, 2013, 1:05 PM
[FIXED] [2.3] TimeField SelectedTime is invalid
Hi,
There seems to be a problem with the TimeField when setting Format and page Culture.
I set the Format to "h:mm:ss tt" and SelectedTime to 15:23. The value displayed in the time field is "3:23:00 p.m.", while the values in the list look like this: "3:45:00 pm". The time field is invalid: "3:23:00 p.m. is not a valid time".
If I choose a value from the list and press OK, the SelectedTime has a value of -10675199.02:48:05.4775808. The Value and Text fields have the same value as the SelectedTime, while the RawText and RawValue fields have the correct value.
Version of Ext.Net: 2.2.0.1
Framework: .NET Framework 4
Operating system: Windows 8
Visual Studio version: 2012
I've tested this on Firefox 21, Chrome 27 and IE 10.
Simplified code:
There seems to be a problem with the TimeField when setting Format and page Culture.
I set the Format to "h:mm:ss tt" and SelectedTime to 15:23. The value displayed in the time field is "3:23:00 p.m.", while the values in the list look like this: "3:45:00 pm". The time field is invalid: "3:23:00 p.m. is not a valid time".
If I choose a value from the list and press OK, the SelectedTime has a value of -10675199.02:48:05.4775808. The Value and Text fields have the same value as the SelectedTime, while the RawText and RawValue fields have the correct value.
Version of Ext.Net: 2.2.0.1
Framework: .NET Framework 4
Operating system: Windows 8
Visual Studio version: 2012
I've tested this on Firefox 21, Chrome 27 and IE 10.
Simplified code:
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Threading" %>
<%@ Import Namespace="System.Globalization" %>
<script runat="server">
const string PAGE_CULTURE = "ro-RO";
protected void Page_Load( object sender, EventArgs e )
{
if ( !Page.IsPostBack )
{
fldTime.Format = "h:mm:ss tt";
fldTime.SelectedTime = new TimeSpan( 15, 23, 0 );
}
}
protected override void InitializeCulture()
{
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture( PAGE_CULTURE );
Thread.CurrentThread.CurrentUICulture = new CultureInfo( PAGE_CULTURE );
base.InitializeCulture();
}
protected void btnOK_DirectClick( object sender, Ext.Net.DirectEventArgs e )
{
TimeSpan tsValue = fldTime.SelectedTime;
}
</script>
<html>
<head><title>Set Culture</title></head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server"></ext:ResourceManager>
<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Container ID="Container1" runat="server" Region="Center">
<Items>
<ext:Panel ID="Panel1" runat="server" Layout="FormLayout">
<Items>
<ext:TimeField ID="fldTime" runat="server" FieldLabel="Time" Margin="5" InputWidth="120" LabelWidth="50" AllowBlank="false" AllowOnlyWhitespace="false"></ext:TimeField>
</Items>
<Buttons>
<ext:Button ID="btnOK" runat="server" Text="OK" OnDirectClick="btnOK_DirectClick"></ext:Button>
</Buttons>
</ext:Panel>
</Items>
</ext:Container>
</Items>
</ext:Viewport>
</form>
</body>
</html>
I'd like to know if this is going to be fixed or it's a known issue (with a workaround hopefully). We need to deliver a proof-of-concept application using Ext.Net and once it's approved by the client, we'll buy the Ext.Net license. However, this TimeField issue is a major problem for us.
Last edited by Daniil; Jul 05, 2013 at 12:21 PM.
Reason: [FIXED] [2.3]