Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

DaysBetween: Add trigger #2844

Closed
stevenmg opened this issue Apr 7, 2016 · 5 comments · Fixed by #4464
Closed

DaysBetween: Add trigger #2844

stevenmg opened this issue Apr 7, 2016 · 5 comments · Fixed by #4464

Comments

@stevenmg
Copy link

stevenmg commented Apr 7, 2016

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

@iambibhas
Copy link
Collaborator

Same with days since. e.g. days since march 28. right now its days between march 29 and today

@GuiltyDolphin
Copy link
Member

Sounds like some special cases we could just map to their 'normal form'!

@stevenmg
Copy link
Author

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?

@GuiltyDolphin
Copy link
Member

@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.

@stevenmg
Copy link
Author

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.

moollaza pushed a commit that referenced this issue Sep 13, 2017
* 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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants