Dialogflow obtaining wrong dates for prebuilt date entities - dialogflow-es

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.

Related

Amazon Quicksight Dynamic date filter

so everyday I receive sales data from the previous day. So today November 15 I have data from July 2021 until November 14 2021. What I want is to show this data for the current month by aggregating by day. I use a quicksight visual with a MTD (Month To Date) filter. Everything is fine so far.
The problem is on each first date of the month, I see "No Data" on my visual which is normal since I do not have any data from the current day/month but as I said earlier from the day before.
So what I want to achieve is:
Each 1st of current month: show data from the whole previous month
From 2nd to last day of current month: show data from the current month
Can someone help me please to know how I can achieve this?
I looked for ways to do this and I found dynamic default parameters but this option is not fine with me since I have to fill a username column according to the documentation (https://docs.aws.amazon.com/quicksight/latest/user/parameters-set-up.html) and I have many users so it will be not interesting to list all of them.
You can assign parameters to a group rather than a specific user which is much quicker
There is new functionality which allows you to set today or beginning/ending of month/quater/year as default.
See screenshot:
enter image description here

Power Automate: Send reminder out 3 months in advance

I have a Microsoft List that has a column called Expiration Date (text in format of MM/DD/YYYY) and Point of Contact (text in format of email#domain.com). How do I create a flow that sends an email out to the Point of Contact 3 months in advance?
My idea was to create a scheduled cloud flow that:
Repeats every day
Looks at every row in specific list
Compares if Expiration Date - 3 Months = Today
If True, send email to Point of Contact
I am currently stuck on step 3 to compare the date. I did Subtract from time to subtract 3 months from Expiration Date but now I do not know how to use this value to compare to today's date.
A better approach is to filter the list by using an OData filter. That will result in a list with all the elements you need.
For doing so, you need to specify the "Filter Query" field (in red):
First type
ExpirationDate eq ''
Then, between the quotes, add an expression, and select the functions addDays and utcNow in the following way:
addDays(utcNow(),92,'MM/dd/yyyy')
Please notice the following:
I'm adding 92 days to get the same day three months in advance for today (today is Oct 18th, so I'm looking for Jan 18th). Maybe adding just 90 days would work for you.
If you just want to add 3 to the month, you would need to get today's date to a variable with utcNow('MM') to get only the month, add 3 to it, and then create the expression accordingly.
I'm sorry the UI is in spanish. I'm from Mexico. But it's the same idea.
In the image, it reads "ExpirationDateText" because that's the way I named the field in my example. In your case, "ExpirationDate" should work.

Create own date mappings in API.ai

I want to create a mapping of date ranges and what a user says.
For example:
When a user says "MTD sales for Product A", I want the bot to understand that MTD means current month start to today (Date-Period format). How can I do this?
Also, the agent is able to understand first half of last month (15 day range) but cannot understand "first 15 days of last month". How can I map this statement to a date range so that it learns similar examples for the future?
Maybe you can create an entity for date-period formats with the list of formats you want to support?
Then the selected format could be sent to your custom webhook configured in fullfillment. You would receive this format as a parameter in your backend and could do anything you want with this information.

How to know the current quarter with date?

Is it possible to know the current quarter using Linux command line?
I didn't find a way to do it within the date man page.
The dates corresponding to the start and end of a fiscal quarter vary by country, as well by the nature of the entity doing the fiscal reporting (corporate/personal/government/other...); some companies also have alternate schedules. As such, there is no standard API for this. You will have to get the current month and date and compare it to the appropriate quarter start/end dates for the country and entity of interest. You can find the dates for some countries in wikipedia.
There is now the %q format to show this information.
From the coreutils-8.26 release log from November 30, 2016:
New Features
...
date now accepts the %q format to output the quarter of the year.
And yes it works!
$ date "+%q"
4
$ date "+%Y%q"
20164

Sharepoint 2007 date time in a list

We are using a custom list on Sharepoint where we require users to enter data with a date and time field. We have been facing huge issues in data validity when generating reports due to this field. Following are the kinds of mistakes:
Selecting AM instead of PM or vice verse. Changing to 24 hrs format doesn't help much because then the users select (as an example) 02:00 instead of 14:00 for 02:00PM.
There are errors regarding formats of dates, hence some entries have dates from the future or the past.
As the reports are generated each week, the list needs to be populated by the end of the week. If the month has changed between the week, people forget to change the month in the calendar and the entries are of the last week of the current month instead of the last week of the previous month.
Are there ways to configure the list(Pref. without programming) so that:
A. Only working hours are available in the time related dropdown.
B. Dates from the future are not allowed( Or not available)
Any help would be appreciated.
As far as I know, you won't be able to satisfy these requirements with no custom code.
If you decide to go down the coding path, what you need to do is create a custom field type. Let me know of you need help on this.

Resources