Default issue date field to today's date #9

Merged
odweta merged 1 commits from odweta-default-invoice-date into main 2026-09-10 17:44:15 +02:00
odweta commented 2026-09-10 17:42:45 +02:00 (Migrated from github.com)

Why

When creating a new invoice, the "Datum vystavení" (issue date) field was left blank, requiring the user to manually pick today's date every time.

What changed

  • New invoices now prefill the issue date input with today's local date when the editor is cleared (clearInvoiceEditor).
  • toDateInputValue now builds the YYYY-MM-DD string from local date components instead of toISOString(), avoiding a potential off-by-one-day shift for users in timezones ahead of UTC (e.g. late evening local time rolling to the next UTC day).

Existing invoices are unaffected since loadInvoiceIntoEditor still uses the stored issueDate value.

## Why When creating a new invoice, the "Datum vystavení" (issue date) field was left blank, requiring the user to manually pick today's date every time. ## What changed - New invoices now prefill the issue date input with today's local date when the editor is cleared (`clearInvoiceEditor`). - `toDateInputValue` now builds the `YYYY-MM-DD` string from local date components instead of `toISOString()`, avoiding a potential off-by-one-day shift for users in timezones ahead of UTC (e.g. late evening local time rolling to the next UTC day). Existing invoices are unaffected since `loadInvoiceIntoEditor` still uses the stored `issueDate` value.
Sign in to join this conversation.