1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 11:27:35 +00:00

LibCore+LibTimeZone: Support time zone names in Core::DateTime::parse

LibCore currently cannot depend on LibTimeZone directly. All build-time
code generators depend on LibCore, so there'd be a circular dependency:
LibCore -> LibTimeZone -> GenerateTZData -> LibCore.

So to support parsing time zone names and applying their offsets, add a
couple of weakly-defined helper functions. These work similar to the way
AK::String declares some methods that LibUnicode defines. Any user who
wants to parse time zone names (from outside of LibCore itself) can link
against LibTimeZone to receive full support.
This commit is contained in:
Timothy Flynn 2023-11-06 20:50:11 -05:00 committed by Andreas Kling
parent fd0075083a
commit 350fdf1e43
7 changed files with 169 additions and 4 deletions

View file

@ -681,6 +681,8 @@ if (BUILD_LAGOM)
lagom_test(../../Tests/LibCore/TestLibCorePromise.cpp LIBS LibThreading)
endif()
lagom_test(../../Tests/LibCore/TestLibCoreDateTime.cpp LIBS LibTimeZone)
# RegexLibC test POSIX <regex.h> and contains many Serenity extensions
# It is therefore not reasonable to run it on Lagom, and we only run the Regex test
lagom_test(../../Tests/LibRegex/Regex.cpp LIBS LibRegex WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../../Tests/LibRegex)