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

Ouverte
#746 4 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

@miachillgood y travaille déjà.

Depuis le 11/6/2026.

  • #811 par @miachillgood — ouverte

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
18/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
nodejs, openapi, typescript
Domaine
api

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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

Langage dominant
TypeScript
Étoiles
264
Forks
177
Merge moyen
10 h 5 min
PR mergées (30 j)
5

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de XeroAPI/xero-node

Toutes les issues de XeroAPI/xero-node

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.