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

Add type for datetime format to allow autocompletion #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grubersjoe
Copy link

Hey. Thanks for this package, it's very useful. I've noticed that the format option simply uses string as type and has no autocompletion. So I think this can be improved by adding the @types/dateformat package and then constructing the type based on that. Works nicely:

image

I've consciously added @types/dateformat to the dependencies and not devDependencies, I think this should be right if the d.ts file of this package relies on it (so it's part of the API of this package).

@@ -73,6 +73,7 @@
},
"license": "MIT",
"dependencies": {
"@types/dateformat": "^5.0.2",
Copy link
Author

@grubersjoe grubersjoe Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason version 4 was skipped for this, but I've checked. Version 5 of dateformat did not change the format masks, so should be fine.

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