Need a special offer?Find out if your project fits.
+

How to ignore last month

Resolved
Martin asked on September 17, 2019

Hello!
I'm trying to ignore the current month data by using the following code:

"slice": {
"reportFilters": [
{
"uniqueName": "creationTimestamp.Year",
"filter": {
"query": {
"last": "month"
}
}
},
...

However, although the front seems to be catching the filter, it does not show any data.
The date format I'm using is: yyyy-MM-dd
Thank you!
 

Attachments:
lastMonth.PNG

1 answer

Public
Vera Didenko Vera Didenko Flexmonster September 18, 2019

Hello, Martin,
 
Thank you for your question.
 
It seems you might be using the date date data type (the default) for the date Field.
We would like to explain that the date query {"last": "month"} is supported only for date string, datetime, year/month/day, year/quarter/month/day date data types. 
More information about the available date data types, please see our guide: https://www.flexmonster.com/doc/managing-data-presentation-json
 
We have prepared a JSFiddle example showing how the date query {"last": "month"} can be used for date fields: https://jsfiddle.net/flexmonster/o2cjzuq8/
 
In this example, dates containing the current month (September) are filtered out. Dates containing the month before (August) are displayed on the grid.
 
Please let us know if this works for you.
You are welcome to contact us in case of questions.
 
Best Regards,
Vera

Please login or Register to Submit Answer