src/main/java/com/conveyal/gtfs/model/Service.java
public boolean activeOn (LocalDate date) {
        // first check for exceptions
        CalendarDate exception = calendar_dates.get(date);

        if (exception != null)
            return exception.exception_type == 1;

        else if (calendar == null)
            return false;

        else {
            boolean outsideValidityRange = date.isAfter(calendar.end_date) || date.isBefore(calendar.start_date);
            if (outsideValidityRange) return false;
            switch (date.getDayOfWeek()) {
                case MONDAY:
                    return calendar.monday == 1;
                case TUESDAY:
                    return calendar.tuesday == 1;
                case WEDNESDAY:
                    return calendar.wednesday == 1;
                case THURSDAY:
                    return calendar.thursday == 1;
                case FRIDAY:
                    return calendar.friday == 1;
                case SATURDAY:
                    return calendar.saturday == 1;
                case SUNDAY:
                    return calendar.sunday == 1;
                default:
                    throw new IllegalArgumentException("unknown day of week constant!");
            }
        }
    }
public boolean activeOn (LocalDate date) {
        // first check for exceptions
        CalendarDate exception = calendar_dates.get(date);

        if (exception != null)
            return exception.exception_type == 1;

        else if (calendar == null)
            return false;

        else {
            boolean outsideValidityRange = date.isAfter(calendar.end_date) || date.isBefore(calendar.start_date);
            if (outsideValidityRange) return false;
            switch (date.getDayOfWeek()) {
                case MONDAY:
                    return calendar.monday == 1;
                case TUESDAY:
                    return calendar.tuesday == 1;
                case WEDNESDAY:
                    return calendar.wednesday == 1;
                case THURSDAY:
                    return calendar.thursday == 1;
                case FRIDAY:
                    return calendar.friday == 1;
                case SATURDAY:
                    return calendar.saturday == 1;
                case SUNDAY:
                    return calendar.sunday == 1;
                default:
                    throw new IllegalArgumentException("unknown day of week constant!");
            }
        }
    }
public boolean activeOn ( LocalDate date ) { // first check for exceptions CalendarDate exception = calendar_dates . get ( date ) ; if ( exception != null ) return exception . exception_type == 1 ; else if ( calendar == null ) return false ; else { boolean outsideValidityRange = date . isAfter ( calendar . end_date ) || date . isBefore ( calendar . start_date ) ; if ( outsideValidityRange ) return false ; switch ( date . getDayOfWeek ( ) ) { case MONDAY : return calendar . monday == 1 ; case TUESDAY : return calendar . tuesday == 1 ; case WEDNESDAY : return calendar . wednesday == 1 ; case THURSDAY : return calendar . thursday == 1 ; case FRIDAY : return calendar . friday == 1 ; case SATURDAY : return calendar . saturday == 1 ; case SUNDAY : return calendar . sunday == 1 ; default : throw new IllegalArgumentException ( "unknown day of week constant!" ) ; } } }
Is this service active on the specified date?
Is this service active on the specified date?