mirror of
https://github.com/enso-org/enso.git
synced 2024-11-27 06:32:30 +03:00
4465d63dd8
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.
374 B
374 B
1 | Number | Party | Title | From | To |
---|---|---|---|---|---|
2 | 71 | Conservative | Margaret Thatcher | 1979-05-04 | 1990-11-28 |
3 | 72 | Conservative | John Major | 1990-11-28 | 1997-05-02 |
4 | 73 | Labour | Tony Blair | 1997-05-02 | 2007-06-27 |
5 | 74 | Labour | Gordon Brown | 2007-06-27 | 2010-05-11 |
6 | 75 | Conservative | David Cameron | 2010-05-11 | 2016-07-13 |
7 | 76 | Conservative | Theresa May | 2016-07-13 | 2019-07-24 |
8 | 77 | Conservative | Boris Johnson | 2019-07-24 | 2022-07-07 |