Results 1 to 2 of 2

Thread: Issue with 'Ext.form.dateField'.

  1. #1
    Ext User
    Join Date
    Oct 2009
    Location
    Banglaore / Chandigarh
    Posts
    32

    Question Issue with 'Ext.form.dateField'.

    Hi All,

    I'm having an issue with dateField being used in my application.

    When I try to set a value into the date field, it sets fine in firefox, but not in IE8.

    Here is the code for my dateField:
    Code:
           var holidayDate = new Ext.form.DateField({          
                id:"holidayDate",
                name:"holidayDate",
                fieldLabel:"Date",
                allowBlank: false,
                format: 'Y-m-d',
                style:'border:0',
                minValue: new Date()        
            });
    and this is how I set the value:
    Code:
    var selectedDate = "2010-06-27";
    Ext.getCmp('holidayDate').setValue(new Date(selectedDate));
    Does anyone have any idea why this could be happening?

    Thanks in advance for the reply.

  2. #2
    Sencha Premium User mankz's Avatar
    Join Date
    Nov 2007
    Location
    Stockholm, Sweden
    Posts
    3,153

    Default

    Your issue is because the way different browsers handle dates (don't pass strings to the Date constructor):

    Code:
    Ext.getCmp('holidayDate').setValue(new Date(2010, 05, 27)); // Months are zero based

Similar Threads

  1. Ext.form.DateField FF3 Rendering issue?
    By wesDuff in forum Ext 2.x: Help & Discussion
    Replies: 6
    Last Post: 19 Jan 2010, 5:18 AM
  2. ext.form.datefield ?
    By iamzoli in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 14 Nov 2008, 7:35 AM
  3. Using Ext.form.Datefield in normal HTML-Form but no data is sent
    By oe2 in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 7 Aug 2008, 1:02 AM
  4. Using Ext.form.DateField
    By schmidetzki in forum Community Discussion
    Replies: 5
    Last Post: 24 Jun 2007, 3:40 PM

Tags for this Thread

Posting Permissions

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