How to insert two Timer conditions

1
0
-1

Hello,

I have a process to do and I need to have two Timer conditions "date and time" to start a task.

I tried to put as a condition a variable of type date, but it still fails.

The date and time should be the same as entered in the form in the variables Date and Time.

Please help me.
Sorry for bad English.
thanks

2 answers

1
+1
-1

You simply need to format the date and time as per the requirements, use a Script Connector to take the inputs from the form and return the correct format for the timer event.

Your script should look something like this:

//Assuming your date is in field myDate and time is in field myTime
//myDate is a Date() field

LocalDate localDate = myDate.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();

//create calendar
Calendar calendar = GregorianCalendar.getInstance();
calendar.set(localDate.getYear(), localDate.getMonthValue(),localDate.getDayOfMonth(), 10, 40, 39);
calendar.getTime();

I'll leave you to sort out the time portion of your requirement :)

regards
Seán

PS: As this reply answers your question, please mark as resolved by ticking the tick mark on the left of this reply.

1
0
-1

What import to get the error LocalDate?

Thanks!!

:)

Comments

Submitted by Sean McP on Fri, 10/14/2016 - 20:00

java.time.LocalDate

Java8...

Notifications