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

DateTimeField min and max datetime 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 datetimes based on an offset (in seconds) from now(), so I can define a valid datetime range around the current time.

Acceptance Criteria

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

Example Form Model

  • Form Model: https://solidsdk.inrupt.net/public/FormLanguage/examples/FormModel/DateTimeField.ttl#formRoot
  • Data S

ource: {Your WebID}

Dev Notes

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

brownhoward avatar Sep 27 '19 19:09 brownhoward