I want to extract the dates form the text like :
week to date / wtd as
date1 = starting date of this week date2 = today’s date
month to date / mtd as date1 = starting date of the this month date2 = today’s date
year to date / ytd as date1 = starting date of this year date2 = today’s date
I have tried to extract using duckling but duckling is not able to extract the dates. I am trying to handle the dates in the custom action, so if I know the duckling output and the granularity as week, month or year I am calculating the date 2 accordingly. Since on parsing these statements duckling is not able to give me any information. Kindly help to figure out this!
My end goal is:
If user is asking the bot :
User : What is my sales wtd ( week to date)
Bot : Calculate the sales between the date1 as starting date of this week and date 2 as today’s date
Note - It would be really great if more queries like last week same day/ last month same day/ last year same day could be also handled!
I hope I am making sense over here!
Any help would be really appreciated.