From d20a7f48a68d97d687f47f2e616dbf24c051b31b Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 19 Nov 2024 12:40:44 -0500 Subject: [PATCH] Export timestamp and duration fn as they were (#112) * Export timestamp and duration fn as they were Signed-off-by: Alex Snaps * Less clear in pub use, so used the export explictly Signed-off-by: Alex Snaps --------- Signed-off-by: Alex Snaps --- interpreter/src/context.rs | 4 ++-- interpreter/src/functions.rs | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/interpreter/src/context.rs b/interpreter/src/context.rs index 47a71b8..bdf0a20 100644 --- a/interpreter/src/context.rs +++ b/interpreter/src/context.rs @@ -188,8 +188,8 @@ impl<'a> Default for Context<'a> { #[cfg(feature = "chrono")] { - ctx.add_function("duration", functions::time::duration); - ctx.add_function("timestamp", functions::time::timestamp); + ctx.add_function("duration", functions::duration); + ctx.add_function("timestamp", functions::timestamp); ctx.add_function("getFullYear", functions::time::timestamp_year); ctx.add_function("getMonth", functions::time::timestamp_month); ctx.add_function("getDayOfYear", functions::time::timestamp_year_day); diff --git a/interpreter/src/functions.rs b/interpreter/src/functions.rs index 457010f..82f49a0 100644 --- a/interpreter/src/functions.rs +++ b/interpreter/src/functions.rs @@ -503,6 +503,11 @@ pub fn exists_one( } } +#[cfg(feature = "chrono")] +pub use time::duration; +#[cfg(feature = "chrono")] +pub use time::timestamp; + #[cfg(feature = "chrono")] pub mod time { use super::Result;