Fixed before/after rules with formatted references

PR #3607 missed to provide the same PR #1824 functionality which you could reference input fields in place of raw dates. This fixes that missing feature.