Feature/add day placeholder to single date formatting (fixes #548)#571
Conversation
|
Thanks you! Setting Direct use fails in Should MONTH/DAY/YEAR placeholders work directly in top_note, or is only CURRENT_DATE supported there? |
|
@faridrashidi check mine code it works with your condition . I have give the PR |
Thanks for testing this.
Date formatting (including Using Supporting raw date placeholders directly in |
|
Are you sure about that? I've found that adding |
Good catch you’re right that The underlying issue in #548 was that This PR only adds the missing Whether including the day in a CV is useful is definitely debatable, but this fixes the inconsistency when |
|
Having a DAY placeholder in single-date template is fine, but it doesn't fully address #548. We also need those placeholders for the top note and the footer. |
|
I’ve added the requested |
|
Hi @sinaatalay @faridrashidi , just checking in on this PR. |
|
Hi @shraddhaa09, I have no comment on this. The developer should decide whether to accept the PR. |
|
I'll review this as soon as I’m back to working on RenderCV. |
…#548) (rendercv#571) - Add DAY placeholders to single date formatting - Add tests for DAY placeholders - Apply ruff formatting - fix: expose DAY placeholders in top note and footer templates - fix: apply ruff formatting for DAY placeholders - refactor: extract build_date_placeholders, add DAY/DAY_IN_TWO_DIGITS support Co-Authored-By: shraddha khetmalis <shraddhakhetmalis915@gmail.com> Co-Authored-By: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
f2e641a to
2649651
Compare
|
Thank you! |
…#548) (rendercv#571) (rendercv#571) - Add DAY placeholders to single date formatting - Add tests for DAY placeholders - Apply ruff formatting - fix: expose DAY placeholders in top note and footer templates - fix: apply ruff formatting for DAY placeholders - refactor: extract build_date_placeholders, add DAY/DAY_IN_TWO_DIGITS support Co-authored-by: Sina Atalay <79940989+sinaatalay@users.noreply.github.com>
This PR adds support for DAY and DAY_IN_TWO_DIGITS placeholders in date templates so that single_date: MONTH/DAY/YEAR renders the correct numeric day in CURRENT_DATE (e.g., 12/13/2025) instead of 12/DAY/2025.
Changes
Updated date_object_to_string in src/rendercv/renderer/templater/date.py to include day = int(date.strftime("%d")) and to populate DAY and DAY_IN_TWO_DIGITS in the placeholders dict.
Extended tests/renderer/templater/test_date.py with cases for:
DAY and DAY_IN_TWO_DIGITS on both Date(...) and "YYYY-MM-DD" inputs.
MONTH/DAY/YEAR to cover the configuration from issue #548.
Motivation
In issue #548, using single_date: MONTH/DAY/YEAR in top_note caused CURRENT_DATE to render as 12/DAY/2025 because DAY was not a supported placeholder. This PR adds the missing placeholders and tests.
Testing
Ran just test) in the Codespace; all tests pass (900 passed).