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:
parent
42c9c57141
commit
70f49d0696
7 changed files with 86 additions and 69 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue