DaysBetween: Add trigger #2844
Comments
Same with |
Sounds like some special cases we could just map to their 'normal form'! |
I'll take this on. Looking into it initially it looks like the IA is setup to trigger with only one date parameter, and it will default the second to today, but the current triggers only include things like "days between" or "days" which does not read well with only one date ("days between apr 9 2017"). We could either add a few extra triggers or remove the need for the date to be at the beginning of the string (eg. "days until apr 9 2017" would work then because days is a trigger word and until would simply be ignored. We could also keep the beginning of the string requirement for multiple dates supplied and only remove it when there is a single date supplied. Thoughts? |
@stevenmg If you have a play around with it and it works, add some test cases and do a PR - if it works then awesome! Just so long as we don't cause it to overtrigger - there's quite a few Date Instant Answers out there. |
Ok, so I removed the need for a date to be at the beginning of the remainder. I also modified the trigger list to remove some more general items (days) but also loosened some others. I think this will improve triggering overall, but if you find any over-triggering we may need to tighten in again. |
* Add "Days until" as a trigger * Added tests * Added test for specific date in the future * Added anchors * Updated test for fixed date in the future
Could add "days until April 9" as a trigger. Currently the closest thing is "days from today to april 9"
IA Page: http://duck.co/ia/view/days_between
Maintainer: @JetFault
The text was updated successfully, but these errors were encountered: