Skip to content

fix: add padding on single digit dates in getDateString helper - #16

Merged
SimonLoir merged 1 commit into
mainfrom
fix/add-padding-on-single-digit-dates
Aug 10, 2026
Merged

fix: add padding on single digit dates in getDateString helper#16
SimonLoir merged 1 commit into
mainfrom
fix/add-padding-on-single-digit-dates

Conversation

@SimonLoir

Copy link
Copy Markdown
Member

This fixes #15

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 84b7f8aa-4cb2-49eb-a155-28f62c71fb39

📥 Commits

Reviewing files that changed from the base of the PR and between 1ea26b7 and 18aba12.

📒 Files selected for processing (4)
  • package.json
  • src/helpers/getDateString.ts
  • tests/builder-invoice.test.ts
  • tests/get-date-string.test.ts

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Standardized generated dates to the consistent YYYY-MM-DD format by zero-padding single-digit months and days.
    • Ensured equivalent date inputs produce identical invoice output.
  • Tests

    • Added coverage for date formatting and invoice date consistency.
  • Chores

    • Incremented the package version to 0.8.3.

Walkthrough

The date helper now returns zero-padded YYYY-MM-DD values. Tests cover string and Date inputs, and the package version increases to 0.8.3.

Changes

Invoice date formatting

Layer / File(s) Summary
Zero-pad invoice dates
src/helpers/getDateString.ts, tests/get-date-string.test.ts, tests/builder-invoice.test.ts
The helper pads single-digit months and days. Tests verify direct formatting and identical invoice XML for string and Date issue dates.
Release version update
package.json
The package version changes from 0.8.2 to 0.8.3.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the date-padding fix in the getDateString helper.
Description check ✅ Passed The description links directly to issue #15, which matches the date-formatting changes.
Linked Issues check ✅ Passed The changes add zero-padding for months and days and include regression tests required by issue #15.
Out of Scope Changes check ✅ Passed The version update and regression tests directly support the date-formatting fix and are not out of scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/add-padding-on-single-digit-dates

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 4 complexity · -1 duplication

Metric Results
Complexity 4
Duplication -1

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@SimonLoir
SimonLoir merged commit a08dc59 into main Aug 10, 2026
4 checks passed
@SimonLoir
SimonLoir deleted the fix/add-padding-on-single-digit-dates branch August 10, 2026 20:45
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 does not validate

1 participant