From 8e6be2a3092db112a5e59042b678654576d57d32 Mon Sep 17 00:00:00 2001 From: Qrius Date: Thu, 26 Sep 2024 00:11:05 +0200 Subject: Fix buggy implementation of format_time --- src/macro_processor/macro_processor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/macro_processor/macro_processor.rs b/src/macro_processor/macro_processor.rs index a5b6a59..326b28f 100644 --- a/src/macro_processor/macro_processor.rs +++ b/src/macro_processor/macro_processor.rs @@ -220,14 +220,15 @@ fn smp_builtin_indent( #[cfg(feature = "time")] fn smp_builtin_format_time( - _smp: &mut MacroProcessor, + smp: &mut MacroProcessor, macro_name: &str, args: &mut [String], ) -> Result { if args.len() < 2 { return Ok(macro_name.to_string()); } - let dt = chrono::DateTime::parse_from_rfc3339(&args[1]) + let timestamp = smp.process_input(&args[1])?; + let dt = chrono::DateTime::parse_from_rfc3339(×tamp) .map_err(|_| SMPError::UnknownError(87, None))?; Ok(format!("{}", dt.format(&args[0]))) } -- cgit v1.2.3