Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 5, 2025

  • Investigate the issue: "January %-29, 2025" indicates date format specifiers are not being processed correctly
  • Identify root cause: Value#to_liquid method in lib/jekyll-github-metadata/value.rb does not handle Time objects properly - they fall through to to_json which can cause issues with date filter parsing
  • Fix the Value#to_liquid method to include Time in the case statement so Time objects are passed directly to Liquid
  • Add test to verify Time objects work correctly with Liquid date filter
  • Run tests to verify fix doesn't break existing functionality (313 tests pass)
  • Code review and security scan (no issues found)

Summary

This PR fixes a backwards compatibility issue with date formatting. The problem was that Time objects were being converted to JSON strings via to_json instead of being passed directly to Liquid's date filter.

Before: Using {{ site.github.updated_at | date: "%B %-d, %Y" }} could produce incorrect output like January %-29, 2025.

After: Time objects are passed directly to Liquid, allowing date filters to work correctly and produce January 29, 2025.

Original prompt

This section details on the original issue you should resolve

<issue_title>Date formatting is not backwards compatible</issue_title>
<issue_description>I see January %-29, 2025</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@benbalter
Copy link
Contributor

@copilot keep working

Copy link
Contributor Author

Copilot AI commented Dec 5, 2025

@copilot keep working

Completed all remaining tasks:

  • Added tests for Time object handling in Value#to_liquid (commit 546ee9d)
  • All 313 tests pass
  • Code review and CodeQL security scan show no issues

The fix ensures Time objects are passed directly to Liquid instead of being converted to JSON strings, which allows date filters like {{ date | date: "%B %-d, %Y" }} to work correctly.

@benbalter benbalter marked this pull request as ready for review December 5, 2025 18:35
@benbalter benbalter merged commit 0bdc6aa into main Dec 5, 2025
16 checks passed
@benbalter benbalter deleted the copilot/fix-date-formatting-compatibility branch December 5, 2025 19:26
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.

Date formatting is not backwards compatible

2 participants