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

40 implement dateformat argument #42

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

mattcoleanderson
Copy link

@mattcoleanderson mattcoleanderson commented Oct 25, 2023

I've implemented the dateformat argument. My implementation isn't the most all encompassing but it allows for better customizaiton. Personally, I prefer ISO 86O1 standard for date formatting (YYYY-MM-DD). Which is not the default, hence my reason for implementing this disabled feature.

I utilized a dictionary to dynamically construct the string literals used for the regex search and the strptime formatting. This implementation allows the user to specify the following string YYYY-MM-DD in any of its 6 permutations:

  • YYYY-MM-DD
  • YYYY-DD-MM
  • MM-YYYY-DD
  • MM-DD-YYYY
  • DD-YYYY-MM
  • DD-MM-YYYY

For now the implementation only allows for delimitation on -, for simplicity. If there is demand for it, a future PR (or this one if wanted now) could add configurable delimitation between -, ., and / (or whatever your heart desires). Possibly by introducing a new argument to the script.

I've also left the default argument as 'DD-MM-YYYY' so as to not break any old code uses of the start date functionality.

For anyone who would like to use this now, I have pushed it to my dockerhub repo: https://hub.docker.com/repository/docker/mattcoleanderson/autodoist/general

It is the 2.0.1-prerelease image. Should this feature be merged in by @Hoffelhas, I will create a non prerelease image built by the official repo.

@mattcoleanderson mattcoleanderson force-pushed the 40-implement-dateformat-argument branch from 5658e5a to fbd5bd5 Compare October 25, 2023 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant