You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDK you're using (please complete the following information):
Version 2.9.0 (still seems to exist in 2.14.1)
Describe the bug
The Xero API returns a MSDateTimeFormat for the payment date. This works out to midnight on the local date for that company. I.e., for an invoice paid on July 27 at any time, it returns a value of /Date(1658880000000+0000)/.
Converting that to a unix timestamp (1658880000) and then a human-friendly date, we get Wednesday, 27 July 2022 00:00:00 GMT.
If I call the ->getFullyPaidOnDateAsDate() function from a server whose timezone is located in the USA, my output looks like this:
Cross-checking against Xero confirms that the payment was made on the 27th.
To Reproduce
Steps to reproduce the behavior:
Record payment on an invoice in a US-based company
Fetch the invoice from the API, and output $invoice->getFullyPaidOnDateAsDate()->format('Y-m-d');, on a server set to a timezone in the US
Observe the that the payment date is wrong by a day
Expected behavior
I'd expect that the getFullyPaidOnDateAsDate() function returns the date that the invoice was fully paid, instead of another adjacent date
The text was updated successfully, but these errors were encountered:
SDK you're using (please complete the following information):
Describe the bug
The Xero API returns a MSDateTimeFormat for the payment date. This works out to midnight on the local date for that company. I.e., for an invoice paid on July 27 at any time, it returns a value of
/Date(1658880000000+0000)/
.Converting that to a unix timestamp (1658880000) and then a human-friendly date, we get Wednesday, 27 July 2022 00:00:00 GMT.
If I call the
->getFullyPaidOnDateAsDate()
function from a server whose timezone is located in the USA, my output looks like this:Note July 26.
Cross-checking against Xero confirms that the payment was made on the 27th.
To Reproduce
Steps to reproduce the behavior:
$invoice->getFullyPaidOnDateAsDate()->format('Y-m-d');
, on a server set to a timezone in the USExpected behavior
I'd expect that the
getFullyPaidOnDateAsDate()
function returns the date that the invoice was fully paid, instead of another adjacent dateThe text was updated successfully, but these errors were encountered: