Is there a way to change how Dialogflow automatically calculates the date meant by a text identified as a pre-built entity like "sys.date" or "sys.date-period"?
Or, is there a way to create your own entity for dates, and specify how it determines the specific day?
Depending on the day of the week, texts like "on Friday" are actually interpreted as the closest Friday to come in the future, instead of the most recent Friday that has already passed.
If you are using @sys.date
entity then you can set the value as date.recent
. It will always try to convert the phrase into most recent date.
For example, if you say on monday, it will give you date of recent monday.
Note that the date.recent
option is available only for @sys.date
not for @sys.date-time
or @sys.date-period
.
EDIT:
You need to select $date.recent
from the options available
As you can see in the example screenshot below, tuesday is converted to most recent tuesday rather than upcoming tuesday.
Hope it helps.