mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
LibTimeZone+Userland: Change timezone functions to use UnixDateTime
This incurs a whole host of changes in, among others, JavaScript Intl and Date.
This commit is contained in:
parent
939600d2d4
commit
82c681e44b
13 changed files with 43 additions and 43 deletions
|
@ -14,7 +14,7 @@ using enum TimeZone::InDST;
|
|||
|
||||
static void test_offset(StringView time_zone, i64 time, i64 expected_offset, TimeZone::InDST expected_in_dst)
|
||||
{
|
||||
auto actual_offset = TimeZone::get_time_zone_offset(time_zone, AK::Duration::from_seconds(time));
|
||||
auto actual_offset = TimeZone::get_time_zone_offset(time_zone, AK::UnixDateTime::from_seconds_since_epoch(time));
|
||||
VERIFY(actual_offset.has_value());
|
||||
EXPECT_EQ(actual_offset->seconds, expected_offset);
|
||||
EXPECT_EQ(actual_offset->in_dst, expected_in_dst);
|
||||
|
@ -183,7 +183,7 @@ TEST_CASE(get_time_zone_offset_with_dst)
|
|||
TEST_CASE(get_named_time_zone_offsets)
|
||||
{
|
||||
auto test_named_offsets = [](auto time_zone, i64 time, i64 expected_standard_offset, i64 expected_daylight_offset, auto expected_standard_name, auto expected_daylight_name) {
|
||||
auto actual_offsets = TimeZone::get_named_time_zone_offsets(time_zone, AK::Duration::from_seconds(time));
|
||||
auto actual_offsets = TimeZone::get_named_time_zone_offsets(time_zone, AK::UnixDateTime::from_seconds_since_epoch(time));
|
||||
VERIFY(actual_offsets.has_value());
|
||||
|
||||
EXPECT_EQ(actual_offsets->at(0).seconds, expected_standard_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue