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
    114
      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,316
    Vote Rating
    1290
      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!

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

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,607
    Vote Rating
    58
      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.

Posting Permissions

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