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

Web and WebWorks Development

Reply
New Developer
Posts: 13
Registered: ‎03-27-2011
My Device: emulator
My Carrier: emulator

dates not getting set in new appointment

I have code to create a new appointment.  EndDate and StateDate are date objects.   When I test the dates are not being created correctly.  The appointment is always Wed, Dec 31, 1969 7:00 PM and the end is being shown as Wed, Dec 31, 1969 8:00 PM.  I've tried the sample code where it uses a new Date object and also get the same issues.  I've tested on a 9930 and a 9850.

 

Is this a bug or is there something else I need to do?

 

 

var appt = new blackberry.pim.Appointment();

if (objItem.Title != null) appt.summary = objItem.Title;

if(objItem.Location != null) appt.location = objItem.Location;

if (objItem.Description != null) appt.note = objItem.Description;

appt.end = objItem.EndDate;

appt.start = objItem.StateDate;

if (objItem.IsAllDay) appt.allDay = true;

var args = new blackberry.invoke.CalendarArguments(appt);

args.view = blackberry.invoke.CalendarArguments.VIEW_NEW;

blackberry.invoke.invoke(blackberry.invoke.APP_CALENDAR, args);

 

Developer
Posts: 289
Registered: ‎10-17-2008
My Device: Torch 9800
My Carrier: Rogers

Re: dates not getting set in new appointment

hi jkh1978,

the code sample shown does not show where you initialize the EndDate and StateDate variables. usually you would initialize with something like EndDate = new Date();

regards,
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.