/// <summary> /// Applies the date to this builder, overwriting any existing date (year/month/day). /// </summary> /// <param name="date">The date. If not <c>null</c>, then this must be a string of the form YYYY, YYYY-MM, or YYYY-MM-DD.</param> public TagUniformResourceIdentifierBuilder WithDate(string date) { if (date == null) { _year = _month = _day = null; return(this); } if (!TagUtil.TryParseDate(date, 0, date.Length, out var year, out var month, out var day)) { throw new ArgumentException("Invalid date " + date, nameof(date)); } return(WithDateYear(year).WithDateMonth(month).WithDateDay(day)); }