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

Đang mở
#746 4 bình luận 1 reaction 0 người được giao Xem trên GitHub

@miachillgood đang làm issue này rồi.

Từ ngày 11/6/2026.

  • #811 của @miachillgood — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
18/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
nodejs, openapi, typescript
Lĩnh vực
api

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
264
Fork
177
Merge trung bình
10 giờ 5 phút
Pull request đã merge (30 ngày)
5

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của XeroAPI/xero-node

Tất cả issue của XeroAPI/xero-node

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.