Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

more date and time variables for the file name #113

Open
b166er opened this issue Aug 25, 2024 · 0 comments
Open

more date and time variables for the file name #113

b166er opened this issue Aug 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@b166er
Copy link

b166er commented Aug 25, 2024

Is your feature request related to a problem? Please describe.
I would like to create some folders with year and as subfolder month, for this I need a separate variable for month. Furthermore, I would like to have the variable with the time without separator 23.59 => (2359), would be great if we also get a separate variable or separate the hours and minutes into separate variables, so that the user can decide for himself what the file name should look like.

Describe the solution you'd like
var naming is just a example, you can provide better naming, my suggestion only applies to the number of variables and the high granularity

time vars:

{iso_time} => 01-02 # already exists 
{time_HM} => 0102
{time_HMS} => 010203
{time_H} => 01
{time_h} => 1
{time_M} => 02
{time_m} => 2
{time_M} => 02
{time_m} => 2
{time_S} => 03
{time_s} => 3

date vars:

{date_Y} => 2024 # already exists: {iso_date_year}
{date_y} => 24
{date_M} => 01 # already exists: {iso_date_month}
{date_m} => 1
{date_D} => 02  # already exists: {iso_date_day}
{date_d} => 2
{date_Q} => 3 # nice2have

Additional context
my current local modification is

diff --git "a/pytr/dl.py" "b/pytr/dl.py"
index 31708d0..9fccb07 100644
--- "a/pytr/dl.py"
+++ "b/pytr/dl.py"
@@ -97,6 +97,7 @@ class DL:
         variables['iso_date_month'] = timestamp.strftime('%m')
         variables['iso_date_day'] = timestamp.strftime('%d')
         variables['iso_time'] = timestamp.strftime('%H-%M')
+        variables['time_HM'] = timestamp.strftime('%H%M')
+        # and so on...
 
         filepath = self.file_destination_provider.get_file_path(
             event_type, event_title, event_subtitle, section_title, document_title, variables)

for using in my yml-config:
filename: "{iso_date}.{time_HM} {event_title}"

@b166er b166er added the enhancement New feature or request label Aug 25, 2024
@b166er b166er changed the title more variable options for date and time in the file name more date and time variables for the file name Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant