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
Not able to customize threshold values with Relative time plugin #1961
Comments
I created a little test for this and it ran without problems. Did you omit the required |
I have added
|
I added a demo for your use case in my dayjs-with-typescript-project and it ran as expected (using The only difference is that I dropped the line Anyway: at least for me this looks like a solution 😄 |
Describe the bug
Not able to customize threshold values with Relative time plugin even after following steps mentioned in the documentation. Docs
I tried to customize it in 2 ways and i have some observations.
delete relativeTime.$i;
on line 123 which reinstalls the plugin.This approach works fine with .js/.jsx files but gives below error for .ts/.tsx files.
Property '$i' does not exist on type 'PluginFunc<RelativeTimeOptions>'.
Expected behavior
As per default behavior of
dayjs("2022-06-21T10:10:10.254Z").fromNow()
method default ranges it show time from 0 sec to 44 sec and after 44 sec it shows 'a min ago'.But we want to customize default behavior, so that it should show time from 0 sec to 59 sec and after 59 it should show 'a min ago'. Same for minutes, hours, days, month. This customization should work with .ts/.tsx files too. Or do we have any other solution to this issue?
Information
The text was updated successfully, but these errors were encountered: