solid-ui icon indicating copy to clipboard operation
solid-ui copied to clipboard

DateField min and max date offsets

Open brownhoward opened this issue 6 years ago • 0 comments

User Story

As a Form Designer, I can optional set for the minimum and/or maximum dates based on an offset (in days) from today's date, so I can define a valid date range around todays date.

Acceptance Criteria

  1. In a Form Model, the 'mindateOffset' and/or 'maxdateOffset' can be optionally defined for a DateField. The offsets are specified in days.
  2. When the form is rendered, the valid date range is determined as: `(today - mindateOffset) <= entered date <= (today + maxdateOffset)
  3. If the entered date is outside of the valid date range, an error is displayed.

Example Form Model

  • Form Model: https://solidsdk.inrupt.net/public/FormLanguage/examples/FormModel/DateField.ttl
  • Data Source: {Your WebID}

Dev Notes

  • If both a hardcoded and an offset date are provided (e.g., ui:maxValue and ?:maxdateOffset), the hardcoded date takes precedence.

brownhoward avatar Sep 27 '19 19:09 brownhoward