Service Desk Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Dates with ServicePages

SOLVED
Go to solution
Highlighted
Stefan_Sagstett
Occasional Advisor

Dates with ServicePages

Hello everybody,

we are creating ServiceCall by ServicePages. No I wanted to have a date field in the ServicePages to fill this field in the ServiceCall.

Now my questions:
HPOV has dates in some type of double I think. My problem now is how to get the date from SP to HPOVSD. Is there a certain method from HPOV for converting the date?

The other way round I would use the method bean.sd_date2java_local_date(deadline), which gives me back a normal date format. But what mehtod can work here?
4 REPLIES
Vasily Kamenev
Honored Contributor

Re: Dates with ServicePages

Hi
Use that
bean.sd_date2java_local_date(deadline)

Vasily
Stefan_Sagstett
Occasional Advisor

Re: Dates with ServicePages

Hi Vasily,

thank you for your answer.

Isn't your method the wrong direction? I wanted to get a date into HPOVSD.

Well, I tried the following with this method:

String _implDateString = request.getParameter("vimplementationDate");
Date nd = new Date();
DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMANY);
nd = df.parse(_implDateString);
long longDate = nd.getTime();
Double _implDate = new Double(longDate);

_implDate = bean.sd_date2java_local_date(_implDate);

...

if (_implDate != null) implDate = _implDate;

...

if (implDate != null) {
sc.setServicecallDate3(implDate);
}

But it doesn't work. Can you help me?

Thanks in advance...

Stefan
Vasily Kamenev
Honored Contributor
Solution

Re: Dates with ServicePages

HI
for putting dat to SD use web-api.jar

import com.hp.ifc.util.ApiDateUtils;

Double xx = ApiDateUtils.date2Double(zz);

real session possible get as bean.sd_sesssion().

Vasily
Stefan_Sagstett
Occasional Advisor

Re: Dates with ServicePages

Thank You Vasily...

This workes really fine :-)
//Add this to "OnDomLoad" event