Skip to content

Add DateTime::format_with token DSL#47

Merged
brickfrog merged 4 commits into
mainfrom
main.ergo-task-add-datetime-formatwith-1780418501483-596086
Jun 2, 2026
Merged

Add DateTime::format_with token DSL#47
brickfrog merged 4 commits into
mainfrom
main.ergo-task-add-datetime-formatwith-1780418501483-596086

Conversation

@brickfrog

Copy link
Copy Markdown
Owner

Closes bead tempo-dwz.4.

Adds DateTime::format_with(pattern) for brace-token custom UTC DateTime formatting with literal passthrough, doubled-brace escapes, fixed-width millisecond/nanosecond tokens, and TempoError rejection for unknown tokens.

Verification:

  • moon fmt --check
  • moon test --target wasm-gc
  • moon test --target js
  • moon test --target native

Verification

Generated by Choir from commands executed in the leaf workspace.

  • moon fmt --check
    • exit: 0
    • head: 9e03938
    • output tail:
Finished. moon: no work to do
  • moon test --target wasm-gc
    • exit: 0
    • head: 9e03938
    • output tail:
Total tests: 287, passed: 287, failed: 0.
  • moon test --target js
    • exit: 0
    • head: 9e03938
    • output tail:
Total tests: 287, passed: 287, failed: 0.
  • moon test --target native
    • exit: 0
    • head: 9e03938
    • output tail:
Total tests: 287, passed: 287, failed: 0.

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself).

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new public formatting API for DateTime that supports a small brace-token DSL, enabling custom UTC timestamp rendering beyond the existing RFC3339-style DateTime::format().

Changes:

  • Introduces DateTime::format_with(pattern) with brace-token parsing, brace escaping, and TempoError for invalid tokens.
  • Adds test coverage for token substitution, literal passthrough, escaping, and unknown-token rejection.
  • Updates the generated public interface (pkg.generated.mbti) to expose the new API.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/tempo.mbt Implements DateTime::format_with and token dispatch helper.
src/tempo_test.mbt Adds blackbox tests validating formatting output and error behavior.
src/pkg.generated.mbti Exposes DateTime::format_with in the generated public API surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tempo.mbt Outdated
@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: comment-only review received — routed to main.ergo-task-add-datetime-formatwith-1780418501483-596086 (leaf pane).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: GitHub Copilot issue-thread comment observed on PR — parent notified with updated gate snapshot (not merge approval).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: fixes pushed by main.ergo-task-add-datetime-formatwith-1780418501483-596086 — resolving threads and checking gates (not merged yet).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: fixes pushed by main.ergo-task-add-datetime-formatwith-1780418501483-596086 — resolving threads and checking gates (not merged yet).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: fixes pushed by main.ergo-task-add-datetime-formatwith-1780418501483-596086 — resolving threads and checking gates (not merged yet).

@brickfrog

Copy link
Copy Markdown
Owner Author

Choir: GitHub Actions rollup reports all checks successful on the latest head — re-check review/merge policy on GitHub (not an approval or merge signal by itself).

@brickfrog brickfrog merged commit 86a55bd into main Jun 2, 2026
2 checks passed
@brickfrog brickfrog deleted the main.ergo-task-add-datetime-formatwith-1780418501483-596086 branch June 2, 2026 16:57
@brickfrog brickfrog mentioned this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants