Results 1 to 3 of 3

Thread: [4.1.0-rc1] Ext.form.field.Time does not accept Date object

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    117
      0  

    Default [4.1.0-rc1] Ext.form.field.Time does not accept Date object

    Ext version tested:
    • Ext 4.1.0-RC1



    Browser versions tested against:
    • Chrome 17



    Description:
    • The timefield does not get the time from date object when setting its value with a date object



    Steps to reproduce the problem:
    • Run the testing code



    The result that was expected:
    • The timefield must show the current time of the date object



    The result that occurs instead:
    • The value is empty



    Test Case:


    Code:
    Ext.require([
        'Ext.*'
    ]);
    
    
    Ext.onReady( function(){
        var timeField = Ext.create('Ext.form.field.Time',{
            renderTo: Ext.getBody(),
    	format  : 'H:i'
        });
        timeField.setValue(new Date());
        // timeField.setValue('3:12'); <- this is OK
    });

    Debugging already done:
    • none



    Possible fix:
    • not provided



    Additional CSS used:
    • only default ext-all.css



    Operating System:
    • Win7 - 32 bit

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,857
    Vote Rating
    1322
      0  

    Default

    Two things...

    When setting the date to new Date() it does set the value just doesn't show the value like when you did '3:12' (which also set the value correctly).

    Both values, new Date() and '3:12', are actually invalid values as neither matches an option from the time field so technically neither should be used.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Redwood City
    Posts
    30,626
    Vote Rating
    54
      0  

    Default

    It does accept a Date object in recent code.

    Plus it also has had a new config snapToIncrement added so that the increment config also becomes the time quantum between values.
    Longtime Sencha geek. Outspoken advocate of pure Javascript Views. Posts my own opinions.

Posting Permissions

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