×

Discussion Board

Results 1 to 3 of 3

Thread: DateField issue

  1. #1
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605

    DateField issue

    Hi,
    I am using DateField. Now i dont set the DateField, as a result, it initializes it to default value i.e 1-1-1970 and time as 00:00.
    Now even after user enters the values in DateField control, when i do

    "timeAndDateField.getDate().getTime()", a null pointer exception is thrown ??
    Is it mandatory to set the datefield with some value ??

  2. #2
    Nokia Developer Expert
    Join Date
    May 2007
    Location
    Mexico D.F
    Posts
    351

    Re: DateField issue

    Hello amitaggarwal

    The value for a DateField can be initially set or left unset. If the value is not set, the DateField.getDate method returns null
    I would suggest that you put an initial value to it (that could be the current time and date)... you can do the following for that:

    DateField date =new DateField("Date", DateField.DATE);
    date.setDate(new java.util.Date()); // Set date to "now"
    form.append(date);
    Each instance of a DateField can be configured to accept either date or time information, or both. This input mode configuration is done by choosing the DATE, TIME, or DATE_TIME mode of this class. The DATE input mode configures the DateField to allow only date information and TIME to allow only time information (hours, minutes). The DATE_TIME mode allows both clock time and date values to be set.
    Hope this helps

  3. #3
    Super Contributor
    Join Date
    Feb 2004
    Location
    Dallas
    Posts
    605

    Re: DateField issue

    Dear rdrincon,
    I am not setting the datefield with a value purposefully ..because nokia series 40 3rd edition devices have a limitation. If i set it, the value of the minute field returned is incorrect.

    Pls refer to the below link for it ..!

    http://wiki.forum.nokia.com/index.ph...es_incorrectly

Similar Threads

  1. J2ME DateField
    By bikerzon in forum Mobile Java General
    Replies: 8
    Last Post: 2010-03-25, 08:48
  2. issue with at+cusd over bluetooth link
    By hbanks in forum General Messaging
    Replies: 2
    Last Post: 2007-09-25, 21:21
  3. RTSP video streaming issue on 6280
    By olivier_irac in forum General Development Questions
    Replies: 0
    Last Post: 2006-12-04, 15:11
  4. DateField on Nokia 3220 (Series 40)
    By TheWheat in forum Mobile Java General
    Replies: 0
    Last Post: 2006-03-28, 21:42
  5. DateField won't show time
    By mehli2002 in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-05, 14:46

Posting Permissions

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