Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Trusted Contributor
Posts: 105
Registered: ‎02-02-2011
My Device: Bold 9900
My Carrier: Airtel

Cannot set Today's date to DateField when initialize with Long.MIN_VALUE

i initialize the DateField with Long.MIN_VALUE using following code

 

DateField df=new DateField("DATE",Long.MIN_VALUE,new SimpleDateFormat(DateFormat.DATETIME_DEFAULT));

 

 

when I click on this field , popup the blackberry date picker with todays date, when I click on popup nothing save to date field , But when I change the date and click , it save the new date to DateField.

 

How I save the Todays Date with this?

Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: Cannot set Today's date to DateField when initialize with Long.MIN_VALUE

Does this work?

 

DateField df=new DateField("DATE",System.currentMillis(),new SimpleDateFormat(DateFormat.DATETIME_DEFAULT));

Highlighted
Trusted Contributor
Posts: 105
Registered: ‎02-02-2011
My Device: Bold 9900
My Carrier: Airtel

Re: Cannot set Today's date to DateField when initialize with Long.MIN_VALUE

Thanks for your Reply 

 

I want to display an empty Date field, So am using Long.MIN_VALUE,

 

the user will able to select the current date when it display.