public static TimeZone calculateTimeZone(Object usertimeZone, TimeZone defaultTimeZone) {
        if (usertimeZone != null) {
            if (usertimeZone instanceof String) {
                return TimeZone.getTimeZone((String) usertimeZone);
            }
            else if (usertimeZone instanceof TimeZone) {
                return (TimeZone) usertimeZone;
            }
            else {
                throw new IllegalArgumentException("TimeZone could be either String or java.util.TimeZone");
            }
        }
        else {
            return defaultTimeZone;
        }
    }
Write the value of Calendar options

@param context
@param uicalendar component
@param optionName the name of an option
@param values the List values of an option
@param pattern the pattern for formatting
@throws IOException if writer is null
primefaces/src/main/java/org/primefaces/util/CalendarUtils.java