Skip to content

Commit

Permalink
Export timestamp and duration fn as they were (#112)
Browse files Browse the repository at this point in the history
* Export timestamp and duration fn as they were

Signed-off-by: Alex Snaps <[email protected]>

* Less clear in pub use, so used the export explictly

Signed-off-by: Alex Snaps <[email protected]>

---------

Signed-off-by: Alex Snaps <[email protected]>
  • Loading branch information
alexsnaps authored Nov 19, 2024
1 parent f774729 commit d20a7f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions interpreter/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions interpreter/src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d20a7f4

Please sign in to comment.