public static List<String> splitRange(String input, String datePattern, String rangeSeparator,
                                          boolean week) {

        // security check
        String token = Constants.SPACE + rangeSeparator + Constants.SPACE;
        if (datePattern.contains(token)) {
            throw new FacesException("Pattern '" + datePattern + "' contains separator '" + token + "'");
        }

        // fast return
        if (input == null || !input.contains(token)) {
            return Collections.emptyList();
        }

        int tokenIndex = input.indexOf(token);
        String from = input.substring(0, tokenIndex);
        String to = input.substring(tokenIndex + token.length());

        if (week) {
            // hardcoded pattern, see JS:
            // formattedValue += ' (' + this.options.locale.weekHeader + ' ' + week + ')';
            int weekNumberIndex = to.lastIndexOf(" (");
            // there are cases when weeknumber might not get displayed on client and therefore not submitted
            if (weekNumberIndex != -1) {
                to = to.substring(0, weekNumberIndex);
            }
        }

        return Arrays.asList(from, to);
    }
Calculates NOW based on the calendar's current timezone or will default to system timezone if none set.

@param uicalendar the base calendar to calculate NOW for
@return an Object representing either a Date or Temporal
primefaces/src/main/java/org/primefaces/util/CalendarUtils.java