Repository navigation
fix(date): support %D, %F, %R, %r, %T and ISO week %G, %g, %V - #1009
Merged
Merged
Conversation
These Ruby strftime conversions were printed literally. The combinations now expand like Ruby (%F is %Y-%m-%d, %r is %I:%M:%S %p, ...) and the ISO 8601 conversions use Monday-based weeks where week 1 holds the year's first Thursday.
harttle
approved these changes
Nov 21, 2026
chris-monahan
added a commit
to chris-monahan/liquidjs
that referenced
this pull request
Nov 29, 2026
- Add VMS date specifier (%v -> %e-%^b-%4Y) to strftime combinations - Match "now" and "today" case-insensitively in date - Return input unchanged when date format argument is an empty string (Upstream harttle#1009 now covers %D, %F, %R, %r, %T, %G, %g and %V.) Co-Authored-By: Gemini 4 Carbon (High) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dateprinted these Ruby strftime conversions literally:{{ "2024-03-10T13:05:09" | date: "%F %T | %D %R %r" }} {{ "2024-12-30" | date: "%G-W%V %g" }}Before:
%F %T | %D %R %rand%G-W%V %gAfter:
2024-03-10 13:05:09 | 03/10/24 13:05 01:05:09 PMand2025-W01 25(same as Ruby)The docs list only
%Zand%qas differences from Ruby's flags, so templates using%For%Tgot the raw text.%D%F%R%r%Texpand to their Ruby patterns throughstrftime, so the memory limit still applies. Width pads with spaces like Ruby (%12Fis2016-01-04).%G%g%Vare the ISO 8601 week-based year and week: weeks start on Monday and week 1 holds the first Thursday, so 2021-01-03 is2020 W53and 2024-12-30 is2025 W01.Added tests in
src/util/strftime.spec.ts; the 7 new ones fail without the change.npm test(1773) andnpm run lintpass. The date specs also pass with TZ set to Asia/Shanghai, America/New_York, Australia/Lord_Howe and Pacific/Kiritimati.