Results 1 to 3 of 3
  1.    #1  
    I have a date picker widget that collects the month and year (no day). The widget collects the correct year, but for some reason the month value is always -1 what it should be, with Jan at 0 and Dec at 11. It's VERY odd. The only related code I have is below...

    Date Picker Widget Setup...

    Code:
    // DATE PICKER: expires
    
    	var expiresAttributes =
    	{
    		label: 'Expires:',
    		modelProperty: 'date',
    		labelPlacement: Mojo.Widget.labelPlacementLeft,
    		month: true,
    		day: false,
    		year: true,
    		minYear: 2009
    	};
    
    	this.expiresModel = {date: new Date()};
    
    	this.controller.setupWidget('expires', expiresAttributes, this.expiresModel);
    ...and the code that extracts the month and year in a handler function...

    Code:
    this.expiresModel['date'].getMonth()
    this.expiresModel['date'].getFullYear()
    Like I said, the above code always provides the correct year but the month value is always off by -1. Has anyone else had this problem? Is it a bug in the SDK??? (haven't tried it on an actual device yet)
    Last edited by Laxidasical; 10/25/2009 at 01:28 PM. Reason: Typo
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  2. moserjj's Avatar
    Posts
    468 Posts
    Global Posts
    470 Global Posts
    #2  
    that's expected behavior - the month is zero based
  3.    #3  
    Ah...never would have thunk it! Thanks, I'll adjust my code accordingly!
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Posting Permissions