Results 1 to 3 of 3

Thread: [CLOSED]Model date fields issues on Android and iPhone

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Feb 2008
    Vote Rating

    Question [CLOSED]Model date fields issues on Android and iPhone

    I've stumbled upon something that might be a bug. Here's what I have, a simple entity with just one date field:

    Ext.regModel('Calendar', {
        fields: [{ name: 'startDate', type: 'date'}]
    Then, I use a store to load json data from a file.

    var calendarStore = new{
        model: 'Calendar',
        autoLoad: true,
        listeners:{load:function(store, records, successful){ alert(records[0].data.startDate); }},
        proxy: {
            type: 'ajax',
            url: './calendar.txt',
            reader: {
                type: 'json',
                root: 'results'
    Notice how I subscribed the load event, and used alert() to see the value of startDate from the first record.
    This is the JSON content of calendar.txt
    The load is successful, but this is what happens:

    • Google Chorme: it shows the correct date, working as expected
    • Android-sdk-windows emulator: shows null
    • iBBDemo2 iPad simulator: show null

    (see screenshot)

    It really doesn't matter what date format I use, I also tried "2010-11-06 20:00:00" and "2010-11-06" but still no luck.

    As a temporary fix, I changed my date field to type:"string" and parsed the value as needed with Date.parseDate(value, "c") <-- this works fine on all 3 testing environments.

  2. #2
    Sencha User evant's Avatar
    Join Date
    Apr 2007
    Sydney, Australia
    Vote Rating


    You need to pass the dateFormat parameter. Chrome is a bit better with parsing dates, so you need to explicitly specify the format for the other browsers.

    {name: 'foo', type: 'date', dateFormat: 'c'}
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Ext User
    Join Date
    Oct 2010
    Vote Rating

    Default Doesn't works for me

    That's my model:
    Ext.regModel('Measure', {
               fields: [
                   {name: 'pk', type: 'int'},
                   {name: 'model', type: 'string'},
                   {name: 'fields', fields: [
                          {name: "date", type: 'date', dateFormat: 'c'},
                          {name: "dimension", type: "string" },
                          {name: "value", type: "float" }
    That's my data part:
    {"pk": 1, "model": "dimension.measure", "fields": {"date": "2010-08-01 08:00:00", "dimension": 1, "value": 83.5}}

    But I still can convert it by hands. That code works fine:
    var date = Date.parseDate(, "c");
    Trying this on Chrome 7.0.517.44

Similar Threads

  1. Advices on form and portability Android/iPhone
    By gabrielstuff in forum Sencha Touch 1.x: Discussion
    Replies: 9
    Last Post: 9 Nov 2010, 4:08 AM
  2. Default Android and iPhone click/tap styles?
    By djkraz in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 21 Sep 2010, 6:47 AM
  3. [FIXED-247] Model date fields do not parse
    By JacobGu in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 2 Sep 2010, 2:50 PM
  4. Iphone, android, webOS and Blackberry compatability breakdown
    By oliverashford in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 23 Aug 2010, 11:16 PM
  5. IPhone, Android, Slates,.... ???
    By steenj in forum Community Discussion
    Replies: 11
    Last Post: 2 Feb 2010, 11:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts