frappe / books

Free Accounting Software
https://frappe.io/books
GNU Affero General Public License v3.0
2.86k stars 660 forks source link

fix: use luxon for Date to and from string #703

Closed 18alantom closed 1 year ago

18alantom commented 1 year ago

Uses luxon DateTime.fromJSDate and DateTime.fromISO to convert from JS date to ISO and from ISO to JS date.

When storing dates the time is not stored, so it's local date that's being stored. Blindly stripping the time information from Date().toISOString() will cause date to jump around.

Mismatch in using different transformations from string to date and vice versa also causes dates to jump around.

Should close #700