surrealdb / surrealdb.java

SurrealDB SDK for Java
https://surrealdb.com
Apache License 2.0
67 stars 21 forks source link

Added LocalDate and LocalDateTime TypeAdapters for Gson #16

Closed akaecliptic closed 1 year ago

akaecliptic commented 1 year ago

Added LocalDate and LocalDateTime TypeAdapters to resolve #11

akaecliptic commented 1 year ago

Still thinking over the cleanest way to add custom adapters and date formatters. Will come back to that later.

phughk commented 1 year ago

Still thinking over the cleanest way to add custom adapters and date formatters. Will come back to that later.

Let's perhaps not overcomplicate things and hardcode the date format since it's protocol-based. Looking at DateTimeFormatter javadoc I think we want to use ISO_OFFSET_DATE_TIME - have a look if that works; If you could have tests that have UTC-0 and UTC+/-5 or something that would be perfect :) Because that would verify it works afaik. Can approve and merge then.