diff options
author | SwissalpS <Luke@SwissalpS.ws> | 2020-06-23 17:38:08 +0200 |
---|---|---|
committer | SwissalpS <Luke@SwissalpS.ws> | 2020-06-23 17:38:08 +0200 |
commit | 3f10c11306e483074f78d6d43b192fb3bb690d64 (patch) | |
tree | 3e944c99adf21e1ab7ad327c7d7a3b0c92432f56 /plugins | |
parent | 02c1b2c4a422dc6cf0b92e32a3275b995d154c71 (diff) | |
download | lite-xl-plugins-3f10c11306e483074f78d6d43b192fb3bb690d64.tar.gz lite-xl-plugins-3f10c11306e483074f78d6d43b192fb3bb690d64.zip |
make formats define-able with config
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/datetimestamps.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/datetimestamps.lua b/plugins/datetimestamps.lua index ecb91c2..e755848 100644 --- a/plugins/datetimestamps.lua +++ b/plugins/datetimestamps.lua @@ -1,9 +1,14 @@ local core = require "core" +local config = require "core.config" local command = require "core.command" +config.datetimestamps_format_datestamp = "%Y%m%d" +config.datetimestamps_format_datetimestamp = "%Y%m%d_%H%M%S" +config.datetimestamps_format_timestamp = "%H%M%S" + local function datestamp() - local sOut = os.date('%Y%m%d') + local sOut = os.date(config.datetimestamps_format_datestamp) core.active_view.doc:text_input(sOut) @@ -11,7 +16,7 @@ end local function datetimestamp() - local sOut = os.date('%Y%m%d_%H%M%S') + local sOut = os.date(config.datetimestamps_format_datetimestamp) core.active_view.doc:text_input(sOut) @@ -19,7 +24,7 @@ end local function timestamp() - local sOut = os.date('%H%M%S') + local sOut = os.date(config.datetimestamps_format_timestamp) core.active_view.doc:text_input(sOut) |