enso/std-bits
Jaroslav Tulach 4465d63dd8
Improved polyglot Date support (#3559)
Significantly improves the polyglot Date support (as introduced by #3374). It enhances the `Date_Spec` to run it in four flavors:
- with Enso Date (as of now)
- with JavaScript Date
- with JavaScript Date wrapped in (JavaScript) array
- with Java LocalDate allocated directly

The code is then improved by necessary modifications to make the `Date_Spec` pass.

# Important Notes
James has requested in [#181755990](https://www.pivotaltracker.com/n/projects/2539304/stories/181755990) - e.g. _Review and improve InMemory Table support for Dates, Times, DateTimes, BigIntegers_ the following program to work:
```
foreign js dateArr = """
return [1, new Date(), 7]

main =
IO.println <| (dateArr.at 1).week_of_year
```
the program works with here in provided changes and prints `27` as of today.

@jdunkerley has provided tests for proper behavior of date in `Table` and `Column`. Those tests are working as of [f16d07e](f16d07e640). One just needs to accept `List<Value>` and then query `Value` for `isDate()` when needed.

Last round of changes is related to **exception handling**. 8b686b12bd makes sure `makePolyglotError` accepts only polyglot values. Then it wraps plain Java exceptions into `WrapPlainException` with `has_type` method - 60da5e70ed - the remaining changes in the PR are only trying to get all tests working in the new setup.

The support for `Time` isn't part of this PR yet.
2022-07-21 06:32:40 +00:00
..
base/src/main/java/org/enso/base Improved polyglot Date support (#3559) 2022-07-21 06:32:40 +00:00
database/src/main/java/org/enso/database Update Database.connect to match new API (#3542) 2022-07-04 20:26:44 +00:00
google-api Google Spreadsheet Reading (#1976) 2021-09-03 21:41:12 +02:00
image/src/main/java/org/enso/image Make sure formatting is applied to std-bits projects (#3477) 2022-05-25 09:26:50 +00:00
table/src/main/java/org/enso/table Improved polyglot Date support (#3559) 2022-07-21 06:32:40 +00:00