mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibTimeZone: Begin parsing and generating DaylightSavings rules
This commit is contained in:
parent
e9e8e2bdf4
commit
0e58b04b5c
Notes:
sideshowbarker
2024-07-17 20:37:55 +09:00
Author: https://github.com/trflynn89
Commit: 0e58b04b5c
Pull-request: https://github.com/SerenityOS/serenity/pull/12008
Reviewed-by: https://github.com/linusg ✅
4 changed files with 95 additions and 9 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
namespace TimeZone {
|
||||
|
||||
enum class DaylightSavingsRule : u8;
|
||||
enum class TimeZone : u16;
|
||||
|
||||
}
|
||||
|
|
|
@ -63,6 +63,9 @@ Optional<StringView> canonicalize_time_zone(StringView time_zone)
|
|||
return canonical_time_zone;
|
||||
}
|
||||
|
||||
Optional<DaylightSavingsRule> __attribute__((weak)) daylight_savings_rule_from_string(StringView) { return {}; }
|
||||
StringView __attribute__((weak)) daylight_savings_rule_to_string(DaylightSavingsRule) { return {}; }
|
||||
|
||||
Optional<i64> __attribute__((weak)) get_time_zone_offset([[maybe_unused]] TimeZone time_zone, AK::Time)
|
||||
{
|
||||
#if !ENABLE_TIME_ZONE_DATA
|
||||
|
|
|
@ -20,6 +20,9 @@ Optional<TimeZone> time_zone_from_string(StringView time_zone);
|
|||
StringView time_zone_to_string(TimeZone time_zone);
|
||||
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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue