remove date library

This commit is contained in:
Fleeym 2024-06-11 17:55:43 +03:00
parent c80f58bb27
commit 5912a8325c
2 changed files with 3 additions and 7 deletions

View file

@ -269,12 +269,9 @@ if (NOT GEODE_BUILDING_DOCS)
# Regex support
CPMAddPackage("gh:google/re2#c9cba76")
# Cool date library
CPMAddPackage("gh:HowardHinnant/date#1ead671")
target_include_directories(${PROJECT_NAME} PRIVATE ${md4c_SOURCE_DIR}/src)
target_link_libraries(${PROJECT_NAME} md4c re2 minizip date)
target_link_libraries(${PROJECT_NAME} md4c re2 minizip)
endif()
target_link_libraries(${PROJECT_NAME} TulipHook geode-sdk mat-json-impl)

View file

@ -2,7 +2,6 @@
#include <Geode/utils/JsonValidation.hpp>
#include <Geode/utils/ranges.hpp>
#include <chrono>
#include <date/date.h>
#include <fmt/core.h>
#include <loader/ModMetadataImpl.hpp>
#include <fmt/chrono.h>
@ -246,8 +245,8 @@ std::string ServerDateTime::toAgoString() const {
Result<ServerDateTime> ServerDateTime::parse(std::string const& str) {
std::stringstream ss(str);
date::sys_seconds seconds;
if (ss >> date::parse("%Y-%m-%dT%H:%M:%S%Z", seconds)) {
std::chrono::time_point<std::chrono::system_clock, std::chrono::seconds> seconds;
if (ss >> std::chrono::parse("%Y-%m-%dT%H:%M:%S%Z", seconds)) {
return Ok(ServerDateTime {
.value = seconds
});