@Override
        public Instant apply(final String value) {
            // Parse the date as best we can.
            ZonedDateTime dateTime = parseBest(value, formatter, zoneId);

            // Subtract a year if the date appears to be after our reference time.
            if (dateTime.isAfter(referenceDateTime)) {
                dateTime = adjustment.apply(dateTime);
            }

            return dateTime.toInstant();
        }
Parsing dates that use week fields has to be done differently as week based parsing does not seem to
cope with conflicting default values for fields.
stroom-pipeline/src/main/java/stroom/pipeline/xsltfunctions/ParseDateTime.java