The "date" property on returned invoices has a TypeScript type of "string" but is in fact a "Date"

Aperta
#746 4 commenti 1 reazione 0 assegnatari Vedi su GitHub

@miachillgood ci sta già lavorando.

Dal 11/6/2026.

  • #811 di @miachillgood — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
18/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
nodejs, openapi, typescript
Ambito
api

Direzione di ricerca

Start with the linked open pull request #811, since the work is already under way there, and check whether it covers date, dueDate and the payment date fields. The repository description says the SDK is generated from the Xero OpenAPI spec, so the type change probably belongs in the spec or generator rather than in hand-edited models. Done means the affected date fields are typed consistently and the maintainers have settled whether they should be string or Date. The issue has no maintainer decision yet, so confirm that before writing code.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

SDK you're using (please complete the following information):

  • Version 10.0.0

Describe the bug
When making a paged request for Invoices, the "date" property on returned invoices has a TypeScript type of "string" but is in fact a "Date". I think string is preferable since there can be timezone ambiguity with Date - for example, was the date string parsed in the context of the server timezone (using standard Date() constructor) or was it parsed using Date.UTC(). Also, thee same thing seems to be happening with the "dueDate" as well as the date on payments.

To Reproduce
Steps to reproduce the behavior:

  1. Fetch a paged list of invoices
  2. See that Invoice.date is actually a date - but it should be a string

Expected behavior
The date property should be a string

Lingua principale
TypeScript
Stelle
264
Fork
177
Merge medio
10h 5m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di XeroAPI/xero-node

Tutte le issue di XeroAPI/xero-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.