Aug 20, 2014, 4:36 AM
[CLOSED] timefield editor default date
I'm having problem with timefield editor in datecolumn. I have two datecolumn with timefield editor, "StartTime" and "EndTime"
The first time it's loaded, the StartTime show "19:00" which it got from database which it's real value is "1900-01-01 19:00". If I choose another StartTime, for example "20:00" the value I got is "1900-01-01 20:00".
And then when I select an EndTime from the dropdown timefield editor, from code behind, this is the value I got "2008-01-01 20:30". The EndTime timefield editor use date "2008-01-01" as it's default date value.
So when I want to get the time difference between 19:00 to 20:30, I can't get the right value, because it also take into count the date difference. My question is how to set the day-month-year of timefield to always refer to the same default value, in this case to "1900-01-01"?
This is my code and screenshots
The first time it's loaded, the StartTime show "19:00" which it got from database which it's real value is "1900-01-01 19:00". If I choose another StartTime, for example "20:00" the value I got is "1900-01-01 20:00".
And then when I select an EndTime from the dropdown timefield editor, from code behind, this is the value I got "2008-01-01 20:30". The EndTime timefield editor use date "2008-01-01" as it's default date value.
So when I want to get the time difference between 19:00 to 20:30, I can't get the right value, because it also take into count the date difference. My question is how to set the day-month-year of timefield to always refer to the same default value, in this case to "1900-01-01"?
This is my code and screenshots
<ext:GridPanel ID="GridPanel2" runat="server" fittoframe="true" AutoScroll="True" MaxHeight="250">
<Store>
<ext:Store ID="STR1" runat="server">
<Model>
<ext:Model runat="server" ID="Model1">
<Fields>
<ext:ModelField Name="StartTime" Type="Date" />
<ext:ModelField Name="EndTime" Type="Date" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel2" runat="server" DefaultSortable="false">
<Columns><ext:DateColumn ID="Column1" runat="server" Text="Start Time" DataIndex="StartTime" Width="100" Format="H:i">
<Editor>
<ext:TimeField ID="edStartTime" runat="server" Format="H:i"/>
</Editor>
</ext:DateColumn>
<ext:DateColumn ID="Column2" runat="server" Text="Time End" DataIndex="EndTime" Width="100" Format="H:i">
<Editor>
<ext:TimeField ID="edEndTime" runat="server" Format="H:i"/>
</Editor>
</ext:DateColumn>
</Columns>
</ColumnModel>
</ext:GridPanel>
Last edited by Daniil; Sep 02, 2014 at 1:07 PM.
Reason: [CLOSED]