-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
Day.js plugins and Typescript #2417
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. |
We are closing this issue as it seems to have grown stale. If you still encounter this problem with the latest version, feel free to re-open it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. We do this to keep the amount of open issues to a manageable minimum. |
A better option is to include this plugin in the TS global typings file we have jQuery and such in at the moment. |
I would like to try this! Would you mind if I do? |
Go for it! |
Originally posted at #2391
Even not using directly, we need to import relativeTime dayjs plugin at
js/src/common/utils/humanTime.ts
. Without this import, typescript can't pick up tipes for the fromNow() method and complains.The code still works though, because relativeTime plugin is installed at
js/src/common/index.js
:https://github.com/flarum/core/blob/2ff46f5a2ebe2532f780f6e60a921beb41876d69/js/src/common/index.js#L12-L16
We can avoid this import if we move this plugin installation process to a separated dayjs library module, something like:
The text was updated successfully, but these errors were encountered: