willow-utils/src/main/java/com/btr/proxy/selector/pac/PacScriptMethods.java
@Override
  public boolean weekdayRange(String wd1, String wd2, String gmt) {
    boolean useGmt = GMT.equalsIgnoreCase(wd2) || GMT.equalsIgnoreCase(gmt);
    Calendar cal = getCurrentTime(useGmt);

    int currentDay = cal.get(Calendar.DAY_OF_WEEK) - 1;
    int from = DAYS.indexOf(wd1 == null ? null : wd1
        .toUpperCase(Locale.ENGLISH));
    int to = DAYS.indexOf(wd2 == null ? null : wd2.toUpperCase(Locale.ENGLISH));
    if (to == -1) {
      to = from;
    }

    if (to < from) {
      return currentDay >= from || currentDay <= to;
    } else {
      return currentDay >= from && currentDay <= to;
    }
  }
@Override
  public boolean weekdayRange(String wd1, String wd2, String gmt) {
    boolean useGmt = GMT.equalsIgnoreCase(wd2) || GMT.equalsIgnoreCase(gmt);
    Calendar cal = getCurrentTime(useGmt);

    int currentDay = cal.get(Calendar.DAY_OF_WEEK) - 1;
    int from = DAYS.indexOf(wd1 == null ? null : wd1
        .toUpperCase(Locale.ENGLISH));
    int to = DAYS.indexOf(wd2 == null ? null : wd2.toUpperCase(Locale.ENGLISH));
    if (to == -1) {
      to = from;
    }

    if (to < from) {
      return currentDay >= from || currentDay <= to;
    } else {
      return currentDay >= from && currentDay <= to;
    }
  }
@ Override public boolean weekdayRange ( String wd1 , String wd2 , String gmt ) { boolean useGmt = GMT . equalsIgnoreCase ( wd2 ) || GMT . equalsIgnoreCase ( gmt ) ; Calendar cal = getCurrentTime ( useGmt ) ; int currentDay = cal . get ( Calendar . DAY_OF_WEEK ) - 1 ; int from = DAYS . indexOf ( wd1 == null ? null : wd1 . toUpperCase ( Locale . ENGLISH ) ) ; int to = DAYS . indexOf ( wd2 == null ? null : wd2 . toUpperCase ( Locale . ENGLISH ) ) ; if ( to == - 1 ) { to = from ; } if ( to < from ) { return currentDay >= from || currentDay <= to ; } else { return currentDay >= from && currentDay <= to ; } }
***********************************************************************
Only the first parameter is mandatory. Either the second, the third, or
both may be left out. If only one parameter is present, the function yields
a true value on the weekday that the parameter represents. If the string
"GMT" is specified as a second parameter, times are taken to be in GMT,
otherwise in local time zone. If both wd1 and wd2 are defined, the
condition is true if the current weekday is in between those two weekdays.
Bounds are inclusive. If the "GMT" parameter is specified, times are taken
to be in GMT, otherwise the local time zone is used.

@param wd1
weekday 1 is one of SUN MON TUE WED THU FRI SAT
@param wd2
weekday 2 is one of SUN MON TUE WED THU FRI SAT
@param gmt
"GMT" for gmt time format else "undefined"
@return true if current day matches the criteria.
**********************************************************************
*********************************************************************** Only the first parameter is mandatory . Either the second the third or both may be left out . If only one parameter is present the function yields a true value on the weekday that the parameter represents . If the string GMT is specified as a second parameter times are taken to be in GMT otherwise in local time zone . If both wd1 and wd2 are defined the condition is true if the current weekday is in between those two weekdays . Bounds are inclusive . If the GMT parameter is specified times are taken to be in GMT otherwise the local time zone is used .