mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibLocale+LibJS+ClockSettings: Make date time format APIs infallible
These APIs only perform small allocations, and are only used by LibJS and the time zone settings widget. Callers which could only have failed from these APIs are also made to be infallible here.
This commit is contained in:
parent
0914e86691
commit
7536648498
9 changed files with 183 additions and 191 deletions
|
@ -135,8 +135,8 @@ void TimeZoneSettingsWidget::set_time_zone_location()
|
|||
auto locale = Locale::default_locale();
|
||||
auto now = AK::UnixDateTime::now();
|
||||
|
||||
auto name = Locale::format_time_zone(locale, m_time_zone, Locale::CalendarPatternStyle::Long, now).release_value_but_fixme_should_propagate_errors();
|
||||
auto offset = Locale::format_time_zone(locale, m_time_zone, Locale::CalendarPatternStyle::LongOffset, now).release_value_but_fixme_should_propagate_errors();
|
||||
auto name = Locale::format_time_zone(locale, m_time_zone, Locale::CalendarPatternStyle::Long, now);
|
||||
auto offset = Locale::format_time_zone(locale, m_time_zone, Locale::CalendarPatternStyle::LongOffset, now);
|
||||
|
||||
m_time_zone_text = DeprecatedString::formatted("{}\n({})", name, offset);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue