From 1c61be14a9a184de4a21d15ca29d1cc9153dc3a2 Mon Sep 17 00:00:00 2001 From: lorenzosinisi Date: Tue, 27 Aug 2024 14:14:03 +0200 Subject: [PATCH] Revert the function TEXT because too custom and can easily be a custom callback --- lib/expression/callbacks/standard.ex | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/expression/callbacks/standard.ex b/lib/expression/callbacks/standard.ex index cc0b791..08657e8 100644 --- a/lib/expression/callbacks/standard.ex +++ b/lib/expression/callbacks/standard.ex @@ -185,23 +185,6 @@ defmodule Expression.Callbacks.Standard do String.slice(to_string(text), start_num - 1, num_chars) end - @expression_doc doc: - "Convert a date into any strftime format (ref: https://man7.org/linux/man-pages/man3/strftime.3.html)", - expression: ~s[text(datevalue(date(2022, 09, 14)), "%m/%d/%Y")], - result: "09/14/2022" - def text(ctx, value, format) do - [value, format] = eval_args!([value, format], ctx) - - value = - if is_map(value) and Map.has_key?(value, "date") do - Map.get(value, "date") - else - value - end - - Calendar.strftime(value, format) - end - @doc """ Converts date stored in text to an actual date object and formats it using `strftime` formatting.