zspatter / clean-desktop

Automated desktop cleaner
The Unlicense
4 stars 0 forks source link

Changing the Month Format #1

Open RmBau opened 4 years ago

RmBau commented 4 years ago

How do I change the month format to text for the directory?

zspatter commented 4 years ago

Sorry for the delay, I haven't been monitoring this repo very closely.

Anyway, you can leverage strftime to achieve this fairly easily. You'll only need to alter 1 line in the EventHandler.py script to alter the directory names for the month.

Essentially, you just need to update the month portion of dated_path from f'{date.today().month:02d}' to f'{date.today().strftime("%B")} The full line for the updated dated_path is shown below (curently line 17).

dated_path = path / f'{date.today().year}' / f'{date.today().strftime("%B")}'

Note: %B will specify the full month name. If you'd prefer the shortened name, use the %b specifier instead. I hope this helps!