private static Consumer<DateTimeParserContext> relWeekDayConsumer() {
        return ctx -> {
            int snapshot = ctx.cursor().value();
            String dayOfWeek = ctx.readStringAtCursor();
            String ordinal = ctx.withCursorValue(snapshot - 2).readStringAtCursor().toLowerCase();
            final TemporalAdjuster adjuster;

            switch (ordinal) {
                case "this":
                    adjuster = nextOrSameDayOfWeek(dayOfWeek);
                    break;
                case "previous":
                case "last":
                    adjuster = Adjusters.previousDayOfWeek(dayOfWeek);
                    break;
                case "next":
                default:
                    adjuster = Adjusters.nthDayOfWeek(dayOfWeek, ordinal);
                    break;
            }

            ctx.withAdjuster(adjuster, ChronoField.DAY_OF_WEEK);
        };
    }
The base time for relative statements.
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/date/DateTimeParser.java