Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Display BINARYTYPE_date_created with timestamp

    I have a DataSource with a binary field on it, and a corresponding database table including the requisite metadata

    Code:
    <field name="ATTACHMENT" type="binary"/>
    Code:
    CREATE TABLE some_table (
      attachment  BLOB,
      attachment_date_created  DATE
    )
    and a ListGrid for displaying its contents

    Code:
    ListGridField attachment  = new ListGridField("ATTACHMENT", "File Name");
    ListGridField filedate = new ListGridField("ATTACHMENT_date_created", "Date");
    I can see that the full date, including time, gets stored correctly when the file is uploaded, but I can't seem to make it show up on my listgrid fetch.

    Code:
    SELECT TO_CHAR(ATTACHMENT_DATE_CREATED, 'MM/DD/YYYY hh24:mi:ss')
    FROM profile_attachment;
    
    --------------------
    08/26/2011 11:40:15
    --------------------
    I thought I could just format the date (e.g., by setting ds field type='datetime', providing a DateDisplayFormat to the ListGridField, etc.), but what I'm seeing is that the time is always 12:00p at the client.

    I assume this is supposed to just work, and that I'm more than likely missing the obvious again? For something that seems to be so simple, I've sure had my share of trouble with file upload / view.


    Bill

    #2
    Congrats, this time you found a bug (well perhaps a buglet). We're dropping the time information as the creation date is being serialized. This is based on having the date value be a marker type ISCDate subclass of Date.

    We'll fix this, but you could get around this by declaring a second "datetime" field with an unrelated name (eg "my_date_created") and copying the value via "new Date(oldDate.getTime());". To do this, use dsResponse.getRecords(), change the data, then call dsResponse.setData() with the updated data.

    Comment


      #3
      Could I expect to find this in a nightly build any time in the near future? If so, I can easily wait on it. If not, I understand the workaround you've provided and will go ahead that way.

      Comment


        #4
        Yes, it's likely we'll fix it next week.

        Comment


          #5
          Just getting around to looking at this again - doesn't look like it ever got sorted out?

          Comment


            #6
            My mistake. Apologies for the noise.

            Comment

            Working...
            X