Use ENCODINGTIME to set the added time, if present, otherwise use the last modified time of the file (only during the first import), fixes #595

This commit is contained in:
emeric
2025-01-18 16:51:31 +01:00
parent 5cfbbeca65
commit c73ff7dc03
11 changed files with 65 additions and 8 deletions
+9 -2
View File
@@ -299,18 +299,25 @@ namespace lms::core::stringUtils::tests
}
}
TEST(Stringutils, date)
TEST(Stringutils, DateToString)
{
const Wt::WDate date{ 2020, 01, 03 };
EXPECT_EQ(toISO8601String(date), "2020-01-03");
}
TEST(Stringutils, dateTime)
TEST(Stringutils, DateTimeToString)
{
const Wt::WDateTime dateTime{ Wt::WDate{ 2020, 01, 03 }, Wt::WTime{ 9, 8, 11, 75 } };
EXPECT_EQ(toISO8601String(dateTime), "2020-01-03T09:08:11.075");
}
TEST(Stringutils, DateTimeFromString)
{
EXPECT_EQ(fromISO8601String("2020-01-03T09:08:11.075"), (Wt::WDateTime{ Wt::WDate{ 2020, 01, 03 }, Wt::WTime{ 9, 8, 11, 75 } }));
EXPECT_EQ(fromISO8601String("2020-01-03"), Wt::WDateTime{});
EXPECT_EQ(fromISO8601String(""), Wt::WDateTime{});
}
TEST(StringUtils, stringEndsWith)
{
EXPECT_TRUE(stringEndsWith("FooBar", "Bar"));