From ac948b22d97c7affd1c8b42e98f8f271fda2a651 Mon Sep 17 00:00:00 2001 From: Compey Date: Thu, 7 Sep 2023 15:19:53 +0530 Subject: [PATCH] chore(tests): remove note comments --- tests/datetime/formatTime.luau | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/tests/datetime/formatTime.luau b/tests/datetime/formatTime.luau index d43c879..a46bd49 100644 --- a/tests/datetime/formatTime.luau +++ b/tests/datetime/formatTime.luau @@ -13,29 +13,17 @@ assert( "expected format specifier '%A, %d %B %Y' to return 'samedi, 26 août 2023' for locale 'fr'" ) --- FIXME: Local timezone formatTime fails due to a rust side bug - -local expectedTimeString = os.date("%Y-%m-%dT%H:%M:%SZ%z", 1693932753) - --- NOTE: UTC Timezone conversions work perfectly fine, issue only for local. --- So far I've made it so that format_time always converts to_universal_time --- Builder object. Then in to_string, we construct a ChronoDateTime from the values --- and convert it to the requested timezone. We then format this with our formatter --- string. - --- For debugging, try checking what to_universal_time returns, maybe that's where --- an incorrect DateTimeBuilder is getting returned... If that's the case, that means --- there probably isn't any issue with to_string at all. - --- Yes, an invalid DateTimeBuilder is being returned turns out. Still don't know why actually. +local expectedTimeString = os.date("%Y-%m-%dT%H:%M:%SZ", 1694078954) print( expectedTimeString, - DateTime.fromUnixTimestamp(1693068988):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en") + DateTime.fromUnixTimestamp(1694078954):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en") ) assert( - DateTime.fromUnixTimestamp(1693068988):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en") + DateTime.fromUnixTimestamp(1694078954):formatTime("local", "%Y-%m-%dT%H:%M:%SZ", "en") == expectedTimeString, "invalid ISO 8601 formatting for DateTime.formatTime() (local)" ) + +-- TODO: Locale tests, by using os.date()