-
Notifications
You must be signed in to change notification settings - Fork 342
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
Option to disable abbreviations introduced in 2.5.0? #501
Comments
All of the single unit abbreviations added in 2.5.0 - as well as the "mo" abbreviation for month are causing problems in our application. I'd be happy enough with an option to disable all abbreviations - since this also led to me finding some edge cases that feel buggy in our application in |
Hello. Sorry for my very late reply. It's a reasonable request, but I want to understand the problem more.
|
Hey @wanasit, thanks so much for your reply and again for the incredible work! In our app we show the user a preview of the reminder they're creating. It's at this stage, during previewing, that these abbreviations become problematic. A user may begin to type something like I tried debouncing our calls to |
@slapbox Could you take a look at the change in 787c41b? The strict mode now won't allow abbreviations on the timeunits. For your use-case, if you need to allow casual, you'd have to customize Chrono or replacing or adding those parsers. e.g.:
Would this work for your use-case? |
Thank you again for your great work @wanasit! It would be workable but it does have some significant downsides to have to disable all abbreviations. For example, I wonder what you'd think of an option to only allow abbreviations directly attached to numbers? For example Right now I'm leaning towards disabling all abbreviations if we have to go that route, but it would be great to be able to tell users " |
As a user types "1 month" in our app, the fact that "1 m" is initially recognized as minute creates some ugliness as the text starts out for 1 minute from the current time, then updates to 1 month.
The text was updated successfully, but these errors were encountered: