code: function wrap (rule) {
    return function ($) {
      let value = rule($)
      if (!value) return
  
      // remove whitespace for easier parsing
      value = value.trim()
  
      // convert isodates to restringify, because sometimes they are truncated
      if (isIso(value)) return new Date(value).toISOString()
  
      // try to parse with the built-in date parser
      const native = new Date(value)
      if (!isNaN(native.getTime())) return native.toISOString()
  
      // try to parse a complex date string
      const parsed = chrono.parseDate(value)
      if (parsed) return parsed.toISOString()
    }
  }
docs: Wrap a rule with validation and formatting logic.
  
  @param {Function} rule
  @return {Function} wrapped