DateTime handling in Store

  1. #1

    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:
    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
  2. #2

    RE: DateTime handling in Store

    Hi Peter,

    Yes, there are some options. I'll have to make a sample for you.


    Geoffrey McGill
    Founder
  3. #3

    RE: DateTime handling in Store

    Hello,

    I would be interested in a sample too.

    Thanks,

    George

  4. #4

    RE: DateTime handling in Store

    ...as would I.

    Actually, as datetime is a normal type in most .net datasources, an authoritative example seems like something almost everyone would benefit from.

Similar Threads

  1. Store Reader DateTime Parsing w/ milliseconds
    By Thinjon100 in forum 1.x Help
    Replies: 2
    Last Post: Nov 20, 2013, 10:03 AM
  2. Replies: 0
    Last Post: Apr 18, 2012, 7:08 AM
  3. [CLOSED] Store Exception Handling
    By peter.campbell in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: May 19, 2011, 3:35 PM
  4. Datetime
    By Wtower in forum 1.x Help
    Replies: 1
    Last Post: Sep 05, 2009, 9:53 AM
  5. [CLOSED] Error handling in GridPanel/Store AjaxEvents
    By jchau in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Mar 09, 2009, 5:49 PM

Posting Permissions