cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
555
Views
0
Helpful
1
Replies

Does the date entered fall on a Saturday or Sunday?

george.ingles
Level 1
Level 1

Has anyone had to verify the date, entered by the caller, doesn't fall on a Saturday or Sunday? If so how did you do it? We are running UCCX 5.0(2) premium edition. Thanks.

1 Reply 1

geoff
Level 10
Level 10

Jump into the Expression Editor and create a GregorianCalendar class. It will tell you all these things, and more. It will deal with leap years and other tricky little things.

Now if you don't know how to use the Expression Editor, please read the manual. It's a bit tricky to describe, but you can actually double-click on where you see the class and type your own class there, and it will make one for you, and then you can use the methods on that class that the editor can see through reflection.

GregorianCalendar is a standard Java class in java.util.* so you will be able to use it.

You basically take their date entry, make a GregorianCalendar, and then check to see if it's the weekend.

NOTE: Month is 0-11, so subtract 1 from what they entered!!! Tricks people up.

GregorianCalendar gc = new GregorianCalendar(int year, int month, int dayOfMonth)

if (gc.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY ||

    gc.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY)

// off you go

Regards,

Geoff