Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

Does the date entered fall on a Saturday or Sunday?

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.


Re: Does the date entered fall on a Saturday or Sunday?

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