1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 21:17:45 +00:00

LibJS+LibTimeZone+LibUnicode: Indicate whether a time zone is in DST

Return whether the time zone is in DST during the provided time from
TimeZone::get_time_zone_offset,
This commit is contained in:
Timothy Flynn 2022-01-19 14:18:02 -05:00 committed by Linus Groh
parent 42c9c57141
commit 70f49d0696
7 changed files with 86 additions and 69 deletions

View file

@ -14,6 +14,16 @@
namespace TimeZone {
enum class InDST {
No,
Yes,
};
struct Offset {
i64 seconds { 0 };
InDST in_dst { InDST::No };
};
StringView current_time_zone();
Optional<TimeZone> time_zone_from_string(StringView time_zone);
@ -23,7 +33,7 @@ Optional<StringView> canonicalize_time_zone(StringView time_zone);
Optional<DaylightSavingsRule> daylight_savings_rule_from_string(StringView daylight_savings_rule);
StringView daylight_savings_rule_to_string(DaylightSavingsRule daylight_savings_rule);
Optional<i64> get_time_zone_offset(TimeZone time_zone, AK::Time time);
Optional<i64> get_time_zone_offset(StringView time_zone, AK::Time time);
Optional<Offset> get_time_zone_offset(TimeZone time_zone, AK::Time time);
Optional<Offset> get_time_zone_offset(StringView time_zone, AK::Time time);
}