Problem/Motivation

Part 6 of splitting #3595219: 3.0 Exploration. This issue exposes the configuration of the date and time element family (date, time, datetime, datelist) for querying. Submission parsing/validation for these elements is intentionally split into a follow-up (part 7) to keep each piece reviewable.

Missing in 3.x:

  • time: min, max, step.
  • date: the date-specific configuration fields and the default value.
  • datelist / datetime: which date/time parts are shown, the part order, and the per-part title display.

Proposed resolution

  • Expose time min / max / step.
  • Expose the date element fields and resolve its default value correctly (building on the default-value producer from #3598935: Improve cacheability and rendering).
  • Expose the datelist/datetime fields, backed by new enums for the date parts and their title display: WebformDatePart, WebformDatePartTitleDisplay, WebformDatetimeDateElement, WebformDatetimeTimeElement.

This is read-only field exposure via WebformElementMetadata.php and the schema builder; no submission logic changes here.

Remaining tasks

  • Add enums WebformDatePart, WebformDatePartTitleDisplay, WebformDatetimeDateElement, WebformDatetimeTimeElement under src/Enum/; wire into WebformSchemaBuilder.php.
  • Expose time/date/datelist fields in WebformElementMetadata.php and WebformExtension.php; resolve the date default value.
  • Tests: TimeTest, DateBasedElementsTest, DateExtrasTest, DatelistTest, plus the time.gql / datelist.gql / datetime_extras.gql fixtures and shared test-form additions.

API changes

Additive: new fields on time / date / datelist / datetime elements and the supporting date-part enums. No fields removed.

Release notes snippet

Date and time elements now expose their configuration — time min/max/step, date fields and default value, and the datelist/datetime parts, order and per-part title display.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

pfrenssen created an issue. See original summary.

  • pfrenssen committed 3693a93d on 3.x
    feat: #3598994 Date/time field exposure
    
    By: dulnan
    By: pfrenssen
    
pfrenssen’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.