Jun 22, 2009, 7:56 AM
DateTime handling in Store
Hi,
how do you guys handle DateTime values when you need the Date AND the Time portion of the field?
For example, assume that you bind a list of FlightEntries:
In the store you have a Start and an End entry only, so somehow you must manage this data splitting (I don't want to extend the Flight object by these artificial properties).
When displaying the data you use a properly formatted DateRenderer, when updating you provide Javascript code to join the fields together.
So it is manageable but it sounds like a lot of work. Is there a simpler way to handle this? Does e.g. the store allow you define such a mapping?
thx,
Peter
how do you guys handle DateTime values when you need the Date AND the Time portion of the field?
For example, assume that you bind a list of FlightEntries:
public class Flight
{
public DateTime Start { get;set; }
public DateTime End { get;set; }
public Guid ID { get; set; }
};
Due to Extjs (and thus Coolite) having a DateTime field which allows you to set the Date part only and sets the time value to 00:00, you must have for each DateTime column two separate columns (StartDate, StartTime, EndDate, EndTime).In the store you have a Start and an End entry only, so somehow you must manage this data splitting (I don't want to extend the Flight object by these artificial properties).
When displaying the data you use a properly formatted DateRenderer, when updating you provide Javascript code to join the fields together.
So it is manageable but it sounds like a lot of work. Is there a simpler way to handle this? Does e.g. the store allow you define such a mapping?
thx,
Peter