duckling
duckling copied to clipboard
Grain returned on time interval
When using a message with a time interval like "from 26th oct until 27th oct 3pm", I'm getting the correct times (from '26-10-2018 00:00:00', to '27-10-2018 15:00:00'), but, in my opinion, wrong grain information. Both times are returning grain 'hour', but the 'from' time should be returning 'day' instead, while the 'to' grain is correct as 'hour'. The decision to use the less or more specific grain would then be on the developer using the library.
Is this the intended functionality for any reason?
Thanks for the feedback @fil090302. Indeed we're returning the lowest grain for the sake of simplification, as this works for 99% of the use cases.
Hi @patapizza, I understand that. However, for my use case, it's important to understand how specific the query was on each of the limits. I'll also check the code and try to add this improvement as a PR. Thanks!
@fil090302 My use case also requires specific grain information for each of time intervals. Were you able to add improvement? Any other hacks to get to the specifics?
@ashokramadass Can't help much.. I was able to avoid the issue for my specific case, but didn't have the time to submit a PR here.