Skip to content

Add Calendar support to dateFormat helper (#1079) - #1227

Merged
jknack merged 2 commits into
jknack:masterfrom
yashdotdev13:fix/1079-calendar-dateformat-support
Nov 29, 2026
Merged

jknack merged 2 commits into
jknack:masterfrom
yashdotdev13:fix/1079-calendar-dateformat-support

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Description

Fixes #1079.

Adds support for java.util.Calendar instances in the dateFormat helper.

Changes

  • Added handling for Calendar instances in toTemporalAccessor().
  • Converts Calendar to Instant using Calendar.toInstant().
  • Added a regression test in DateFormatTest verifying Calendar-based date formatting.

Testing

  • mvn -pl handlebars "-Dtest=DateFormatTest#formatCalendar" test — passed.
  • mvn -pl handlebars -Dtest=DateFormatTest test — 3 failures in existing tests (formatDate, formatInstant, and formatOffsetDateTime).
  • Verified that the same 3 failures also occur against the unmodified upstream code.

The new Calendar regression test passes successfully.

@yashdotdev13

Copy link
Copy Markdown
Contributor Author

hi @jknack I have merged the latest upstream master into this branch and pushed the update.

Validation results:

  • DateFormatTest#formatCalendar passes.
  • Full Handlebars module tests: 1,361 tests, 3 failures.
  • The three failures are existing DateFormatTest cases (formatDate, formatInstant, and formatOffsetDateTime).
  • I reproduced these same failures against the unchanged upstream baseline, so they are unrelated to this PR.
  • mvn -pl handlebars -DskipTests package succeeds.
  • mvn -DskipTests package succeeds across all 11 Maven modules.

I have left the unrelated date-formatting tests and implementation unchanged.

@jknack jknack added this to the 4.6.0 milestone Nov 29, 2026
@jknack
jknack merged commit 767f224 into jknack:master Nov 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[StringHelpers] Add support for Calendar in dateFormat

2 participants