Skip to content

Correct timestamp.format help text to reference date-fns, not dayjs - #527

Merged
gschier merged 1 commit into
mainfrom
fix-timestamp-format-help-text
Aug 12, 2026
Merged

Correct timestamp.format help text to reference date-fns, not dayjs#527
gschier merged 1 commit into
mainfrom
fix-timestamp-format-help-text

Conversation

@gschier

@gschier gschier commented Aug 12, 2026

Copy link
Copy Markdown
Member

timestamp.format passes the format string to date-fns, but the description advertised dayjs. The two disagree on escaping ('MM' vs [MM]) and on tokens — yyyy-MM-dd HH:mm:ss renders as yyyy-08-We under dayjs, so switching libraries was not an option.

The example was also unescaped: yyyy-MM-dd at HH:mm:ss renders as 2026-08-12 AM1786548645 08:30:45, since a and t are live tokens.

Reported in https://yaak.app/feedback/posts/timestamp-formatting-not-escaping

The format string is passed to date-fns, which escapes literals with
single quotes rather than dayjs's square brackets. The example was also
unescaped, so 'at' rendered as AM plus a unix timestamp.
@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

Corrects the timestamp.format help text to accurately describe date-fns formatting syntax.

  • Replaces the incorrect dayjs compatibility claim with a date-fns reference.
  • Escapes literal text in the example and explains single-quote escaping.

Confidence Score: 5/5

The PR appears safe to merge.

The changes are limited to correcting user-facing help text and introduce no runtime behavior changes or actionable defects.

Important Files Changed

Filename Overview
plugins/template-function-timestamp/src/index.ts Updates timestamp formatting documentation and its example to match the existing date-fns implementation.

Reviews (1): Last reviewed commit: "Correct timestamp.format help text to re..." | Re-trigger Greptile

@gschier
gschier merged commit 0bf7eae into main Aug 12, 2026
6 checks passed
@gschier
gschier deleted the fix-timestamp-format-help-text branch August 12, 2026 15:12
@thePanz

thePanz commented Aug 12, 2026

Copy link
Copy Markdown

Thanks for fixing @gschier 👍

Would it be possible to mention how to escape the escaping symbol, or link to the date-fns documentation?

@gschier

gschier commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Ah yes @thePanz, I'll add the docs link. date-fns escapes with single quotes like 'YY'

image

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