[
https://issues.apache.org/jira/browse/WW-5778?focusedWorklogId=1049897&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1049897
]
ASF GitHub Bot logged work on WW-5778:
--------------------------------------
Author: ASF GitHub Bot
Created on: 24/Oct/26 13:11
Start Date: 24/Oct/26 13:11
Worklog Time Spent: 10m
Work Description: lukaszlenart opened a new pull request, #2055:
URL: https://github.com/apache/struts/pull/2055
Fixes [WW-5778](https://issues.apache.org/jira/browse/WW-5778)
## What
The html5 theme now renders `<s:datetextfield>` as a native `<input
type="date">` instead of the "works only with the JavaTemplates Plugin!"
placeholder.
- A `java.util.Date` value (including `java.sql.Date`) is rendered as ISO
`yyyy-MM-dd` in the server's default time zone — the zone `DateConverter`
parses in, so the value round-trips. Any other value is rendered as-is, so a
conversion error re-renders the submitted string.
- `format` is no longer required in the TLD. It only lays out the
JavaTemplates split fields; the html5 theme ignores it, because the browser
always submits `yyyy-MM-dd` and displays the date in the user's locale. The
JavaTemplates handler already rendered nothing without `format`, so its
behaviour is unchanged.
- `DateTextField` reports `HtmlControlType.DATE`, so HTML5 constraint
derivation applies. Hand-written `min`/`max` pass through as dynamic attributes.
- simple, xhtml and css_xhtml keep the placeholder; JavaTemplates and
`DateTextFieldInterceptor` are untouched.
## Deliberately left out
- **`required` attribute.** A `required` validator yields only
`data-msg-required`. `addRequiredField` emits `required` only for radio/file
because other controls submit `""`, which the `required` validator accepts. For
a `Date` property `""` converts to null, so the browser and server would agree
— but the provider sees only the control type, and `textfield type="date"`
bound to a `String` would then block input the server accepts. Pinned by
`testRendersNoRequiredOnADateTextField`; tracked in
[WW-5811](https://issues.apache.org/jira/browse/WW-5811) together with
`DateRangeFieldValidator` → `min`/`max`.
- **`java.time` properties** —
[WW-5810](https://issues.apache.org/jira/browse/WW-5810).
- **`DateConverter` misparsing ISO input** under a `dd-MM-yyyy` global
format or a locale such as `nl_NL` (`2026-10-24` → 18 Apr 2030, no conversion
error) — [WW-5812](https://issues.apache.org/jira/browse/WW-5812). It already
affects `textfield type="date"`; it should ship with this in 7.5.0.
## Tests
- New `DateTextFieldTest` (JUnit 3 style, expected-output fixtures): ISO
value from `Date` and `java.sql.Date`, `format` ignored, string value as-is, no
value when empty, dynamic `min`/`max`, common attributes, generic html5
properties.
- `Html5ConstraintRenderingTest#testRendersNoRequiredOnADateTextField`.
- `ConstraintAction` gains a `birthday` property rather than `TestAction`,
whose properties are pinned by `DebuggingInterceptorTest.debugBrowser`.
- Full core suite green (3553 tests); the JavaTemplates plugin's
`DateTextFieldTest` still passes.
Site docs: apache/struts-site PR to follow (datetextfield page examples,
html5 theme template list).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Issue Time Tracking
-------------------
Worklog Id: (was: 1049897)
Remaining Estimate: 0h
Time Spent: 10m
> Support datetextfield tag in the html5 theme
> --------------------------------------------
>
> Key: WW-5778
> URL: https://issues.apache.org/jira/browse/WW-5778
> Project: Struts 2
> Issue Type: Task
> Components: Core Tags
> Reporter: Lukasz Lenart
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 7.5.0
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> h2. Problem
> {{datetextfield}} has a native HTML counterpart, {{input type="date"}}, yet
> the html5 theme (like the simple theme it extends) renders only a
> placeholder: "Tag datetextfield works only with the JavaTemplates Plugin!".
> The only working implementation is in the JavaTemplates plugin's simple theme.
> h2. Proposal
> Implement {{template/html5/datetextfield.ftl}} rendering {{input
> type="date"}}:
> * The submitted and rendered value uses the ISO {{yyyy-MM-dd}} form that
> {{input type="date"}} requires, independent of the tag's required {{format}}
> attribute; define how {{format}} applies in this theme (ignored, or used only
> for display outside the input) and document it
> * Common attributes, dynamic attributes and HTML5 constraint attributes
> ({{min}}, {{max}}, {{required}}) consistent with the other html5 templates
> * Tests with expected-output fixtures, and the tag reference updated to state
> html5 support
> Related: WW-5776 (removal of the tags the html5 theme cannot support)
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)