[BUG]: PDF export shows January 1970 for missing invoice dates
Maintainers usually reply within 2 days
@anshulchikhale30-p is already working on this.
Since Nov 4, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- javascript
- Domain
- backend-api-design
Research direction
Start in frontend/src/utils/generateInvoicePDF.js, where the issue says the issue and due dates are passed to new Date() before formatting; check how the PDF fields are built and read the existing date formatting logic. Compare missing or invalid dates with valid dates for both fields. Done means unavailable dates show a placeholder such as N/A, while valid dates retain their existing formatting.
Written by the indexing model from the issue text.
Description
Bug Description
When exporting an invoice to PDF, missing issue dates or due dates can incorrectly appear as January 1, 1970.
In frontend/src/utils/chainInvoice.js, invoices without a trusted local payload can have issueDate and dueDate set to null.
However, frontend/src/utils/generateInvoicePDF.js passes these values directly to new Date() before formatting them:
new Date(invoice.issueDate)
new Date(invoice.dueDate)
In JavaScript, new Date(null) evaluates to January 1, 1970. As a result, when an invoice has no available date information, the generated PDF may display January 1, 1970 instead of indicating that the date is unavailable.
Steps to Reproduce
- Open an invoice whose original issue or due date information is unavailable locally.
- Export the invoice as a PDF.
- Open the generated PDF.
- Inspect the Issued and Due date fields.
- Observe that a missing date may be displayed as January 1, 1970.
Expected Behavior
If the issue date or due date is missing or invalid, the generated PDF should display an appropriate placeholder such as N/A instead of an incorrect date.
If a valid date is available, it should be formatted and displayed normally.
Actual Behavior
When issueDate or dueDate is null, the PDF generation logic converts the value into a JavaScript Date object, which results in January 1, 1970 being displayed.
Impact
This can cause exported invoices to contain incorrect date information. Since PDF invoices may be shared with customers or used for accounting and record keeping, displaying January 1, 1970 can be misleading and may make the invoice appear to have a date that was never provided.
Suggested Fix
Validate issueDate and dueDate before converting them into Date objects.
- If a date is missing or invalid, display a placeholder such as
N/A. - If a valid date exists, format it using the existing date-formatting logic.
- Apply the same validation to both issue and due dates.
Affected Files
frontend/src/utils/chainInvoice.jsfrontend/src/utils/generateInvoicePDF.js
Environment
- Application: Chainvoice
- Feature: Invoice PDF export
Checklist
- I have joined the Discord server and will post updates there.
- I have searched existing issues to avoid duplicates.
- Dominant language
- JavaScript
- Stars
- 13
- Forks
- 62
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 18
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from StabilityNexus/Chainvoice
-
[BUG]: Smart Batch Suggestions ignore active filters and select invoices hidden from the tablePossibly taken @anshulchikhale30-p claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
StabilityNexus/Chainvoice#331 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Invoices with the same date are sorted out of order (ids compared as strings)Possibly taken @anshulchikhale30-p claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
StabilityNexus/Chainvoice#330 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Stale token-list requests can overwrite state after switching networksPossibly taken @JANAKIRAM218 claimed this 10 days ago. Openbug enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
StabilityNexus/Chainvoice#325 · 1 comment ·
Maintainers usually reply within 2 days
-
[BUG]: Invoice PDF totals overlap the footer with 10 line itemsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
StabilityNexus/Chainvoice#310 · 4 comments ·
Maintainers usually reply within 2 days
-
[BUG]: Batch invoice summary truncates displayed amount precision to four decimal placesPossibly taken @JANAKIRAM218 claimed this 29 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
StabilityNexus/Chainvoice#294 · 2 comments ·
Maintainers usually reply within 2 days
All issues in StabilityNexus/Chainvoice
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day