1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 16:24:59 +00:00
Commit graph

377 commits

Author SHA1 Message Date
Linus Groh
453c78215c LibJS: Implement parsing of TemporalTimeString 2021-11-20 23:10:09 +00:00
Linus Groh
b42b7d5f16 LibJS: Implement parsing of TemporalDateTimeString 2021-11-20 23:10:09 +00:00
Linus Groh
02e7de2cba LibJS: Implement parsing of TemporalDateString 2021-11-20 23:10:09 +00:00
Linus Groh
d0c29c9735 LibJS: Allow string as parameter in Temporal's round() / total()
This is a normative change in the Temporal spec.

See: 1f0c586
2021-11-19 11:06:53 +00:00
Linus Groh
ec1e1f4f12 LibJS: Disallow Temporal.Duration input values to be non-integers
This is a normative change in the Temporal spec.

See: 8c85450
2021-11-17 22:20:59 +00:00
Luke Wilde
3666d2132b LibJS: Remove fallback value for get_offset_nanoseconds_for
This is a normative change in the Temporal spec.

See: 664f02d

Note that the tests are not comprehensive.
2021-11-17 11:30:13 +00:00
Luke Wilde
ac65fb40d9 LibJS: Implement Temporal.PlainDate.prototype.since 2021-11-16 01:06:07 +00:00
Luke Wilde
ddec3bc888 LibJS: Implement Temporal.PlainDate.prototype.until 2021-11-16 01:06:07 +00:00
Luke Wilde
f6ab63993a LibJS: Implement Temporal.ZonedDateTime.prototype.round 2021-11-13 19:48:54 +00:00
Linus Groh
dbe70e7c55 LibJS: Implement Temporal.Duration.prototype.total() 2021-11-13 18:50:54 +00:00
Linus Groh
f0cd727d74 LibJS: Fix logic typo in balance_duration() hours calculation
By using milliseconds_division_result instead of seconds_division_result
here, the result for hours was off by a factor of 60.
2021-11-13 13:32:35 +00:00
Linus Groh
7f8dc395c1 LibJS: Implement Temporal.ZonedDateTime.prototype.with() 2021-11-13 00:25:40 +00:00
Luke Wilde
f65d25682c LibJS: Implement Temporal.ZonedDateTime.prototype.subtract 2021-11-12 09:24:36 +00:00
Luke Wilde
9b8524b463 LibJS: Implement Temporal.ZonedDateTime.prototype.add 2021-11-12 09:24:36 +00:00
Luke Wilde
5e3fe52fc4 LibJS: Implement Temporal.Duration.compare 2021-11-11 21:06:54 +00:00
Luke Wilde
5594a492f0 LibJS: Implement Temporal.ZonedDateTime.prototype.toJSON 2021-11-10 12:56:56 +00:00
Luke Wilde
6856b6168a LibJS: Implement Temporal.ZonedDateTime.prototype.toLocaleString 2021-11-10 12:56:56 +00:00
Luke Wilde
a9ad993e78 LibJS: Implement Temporal.ZonedDateTime.prototype.toString 2021-11-10 12:56:56 +00:00
Linus Groh
1e3e0477cb LibJS: Implement Temporal.PlainMonthDay.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
fa1d5feec0 LibJS: Implement Temporal.PlainYearMonth.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
aca2ef9e1c LibJS: Implement Temporal.PlainDateTime.prototype.with() 2021-11-08 22:19:45 +00:00
Linus Groh
c3c9ac93d0 LibJS: Implement Temporal.PlainDate.prototype.with()
With one caveat: in the PreparePartialTemporalFields AO I made a change
to fix a spec issue that would require the input object to always have a
month or monthCode property.
This is tracked in https://github.com/tc39/proposal-temporal/issues/1910
and may get accepted as-is, in which case we simply need to remove the
NOTE comment.
2021-11-08 22:19:45 +00:00
Linus Groh
310016aee4 LibJS/Tests: Fix Temporal.PlainDate.prototype.equals() tests
Just calling "expect()" doesn't do anything!
2021-11-08 19:12:54 +00:00
Linus Groh
e93ce1ff69 LibJS: Fix nanoseconds formatting in format_time_zone_offset_string()
Two issues:

- The format string said "{:9}", which left-pads with spaces and not
  zeros as required
- Even when correcting that, we were not accounting for step 11 b:
  "Set fraction to the longest possible substring of fraction starting
  at position 0 and not ending with the code unit 0x0030 (DIGIT ZERO)."
  We can safely use trim() for that as the formatted string is known to
  not contain only zeros (which would leave the left-most in place).

Also adds tests for "UTC" and various numeric offsets.
2021-11-07 20:06:28 +00:00
Linus Groh
df2ccb3d38 LibJS: Implement Temporal.Duration.prototype.toLocaleString() 2021-11-07 15:31:28 +01:00
Linus Groh
90fa356b93 LibJS: Implement Temporal.Duration.prototype.toJSON() 2021-11-07 15:31:28 +01:00
Linus Groh
b2548393d2 LibJS: Implement Temporal.Duration.prototype.toString()
I hereby claim "implemented largest AO in LibJS ever" (450 lines). :^)
2021-11-07 15:31:28 +01:00
Luke Wilde
706296374b LibJS: Implement Temporal.ZonedDateTime.prototype.equals 2021-11-07 15:35:16 +02:00
Luke Wilde
ac12581140 LibJS: Implement Temporal.ZonedDateTime.compare 2021-11-07 15:35:16 +02:00
Luke Wilde
c9ec3295d9 LibJS: Implement Temporal.ZonedDateTime.from 2021-11-07 15:35:16 +02:00
Luke Wilde
b8db0ddc70 LibJS: Implement Temporal.ZonedDateTime.prototype.withCalendar 2021-11-05 09:49:47 +01:00
Luke Wilde
58bb73b60f LibJS: Implement Temporal.ZonedDateTime.prototype.withTimeZone 2021-11-05 09:49:47 +01:00
Luke Wilde
d5f2745a19 LibJS: Implement Temporal.ZonedDateTime.prototype.withPlainDate 2021-11-05 09:49:47 +01:00
Luke Wilde
132a56f07c LibJS: Implement Temporal.ZonedDateTime.prototype.withPlainTime 2021-11-05 09:49:47 +01:00
Linus Groh
d129e1ff29 LibJS: Move common code into RejectObjectWithCalendarOrTimeZone
This is an editorial change in the Temporal spec.

See: 5654fe0
2021-11-04 16:17:26 +01:00
Luke Wilde
c001926752 LibJS: Implement Temporal.ZonedDateTime.prototype.startOfDay 2021-11-04 12:11:33 +01:00
Luke Wilde
d1a5254e41 LibJS: Implement Temporal.PlainDateTime.prototype.round 2021-11-03 19:48:08 +01:00
Luke Wilde
84f79d4c51 LibJS: Implement Temporal.ZonedDateTime.prototype.hoursInDay 2021-11-03 17:55:04 +01:00
Luke Wilde
e42431ec7c LibJS: Implement Temporal.PlainDateTime.prototype.toJSON 2021-11-03 11:03:30 +01:00
Luke Wilde
2a98b521b4 LibJS: Implement Temporal.PlainDateTime.prototype.toLocaleString 2021-11-03 11:03:30 +01:00
Luke Wilde
b2bbd4d2b8 LibJS: Implement Temporal.PlainDateTime.prototype.toString 2021-11-03 11:03:30 +01:00
Luke Wilde
b83e3fd01d LibJS: Implement Temporal.PlainTime.prototype.round 2021-11-02 21:42:40 +01:00
Linus Groh
330ac1e5ad LibJS: Implement Temporal.PlainTime.prototype.toZonedDateTime() 2021-11-02 18:40:37 +01:00
Linus Groh
070f056926 LibJS: Implement Temporal.PlainDateTime.prototype.toZonedDateTime() 2021-11-02 18:40:37 +01:00
Linus Groh
e27bb94038 LibJS: Implement Temporal.PlainDate.prototype.toZonedDateTime() 2021-11-02 18:40:37 +01:00
Linus Groh
0e537e2e1f LibJS/Tests: Fix arg name in Instant.prototype.toZonedDateTime() test
"item", not "items".
2021-11-02 17:51:02 +01:00
Linus Groh
654380c2c2 LibJS: Implement Temporal.PlainDate.prototype.subtract() 2021-11-02 13:29:25 +01:00
Linus Groh
bcd96c80f3 LibJS: Implement Temporal.PlainDate.prototype.add() 2021-11-02 13:29:25 +01:00
Linus Groh
07b0aded99 LibJS: Implement Temporal.PlainDateTime.prototype.subtract() 2021-11-02 09:24:35 +01:00
Linus Groh
c4e371b3da LibJS: Implement Temporal.PlainDateTime.prototype.add() 2021-11-02 09:24:35 +01:00