From 8ff3b1ed350d06a5bd791d4cb23ba3f7f6f81b45 Mon Sep 17 00:00:00 2001 From: jgmdev Date: Fri, 11 Mar 2022 06:54:00 -0400 Subject: datetimestamps: added insert custom command --- plugins/datetimestamps.lua | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index bd208f7..2880f99 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -27,8 +27,8 @@ from https://www.lua.org/pil/22.1.html %% the character `%ยด --]] config.plugins.datetimestamps = common.merge({ - format_datestamp = "%Y%m%d" - format_datetimestamp = "%Y%m%d_%H%M%S" + format_datestamp = "%Y%m%d", + format_datetimestamp = "%Y%m%d_%H%M%S", format_timestamp = "%H%M%S" }, config.plugins.datetimestamps) @@ -50,6 +50,11 @@ end command.add("core.docview", { ["datetimestamps:insert-datestamp"] = datestamp, ["datetimestamps:insert-timestamp"] = timestamp, - ["datetimestamps:insert-datetimestamp"] = datetimestamp + ["datetimestamps:insert-datetimestamp"] = datetimestamp, + ["datetimestamps:insert-custom"] = function() + core.command_view:enter("Date format eg: %H:%M:%S", function(cmd) + core.active_view.doc:text_input(os.date(cmd) or "") + end) + end, }) -- cgit v1.2.3