Last month doesn't adhere to min and max values?
See original GitHub issueI am using presets and have a preset called ‘Last Month’ that looks like this.
export const LAST_MONTH: DateRangePreset = {
name: 'Last Month',
range: [
moment()
.subtract(1, 'month')
.startOf('month'),
moment()
.subtract(1, 'month')
.endOf('month')
]
};
I have this construct for internal purposes and just send the range
bit to ngx-daterangepicker-material.
This doesn’t seem to be following the minDate and maxDate settings. I have another preset for Last 30 Days
which seems to be working fine.
export const LAST_30_DAYS: DateRangePreset = {
name: 'Last 30 Days',
range: [moment().subtract(30, 'days'), moment().subtract(1, 'days')]
};
Screenshots
Last Month
Last 30 Days
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Last 7 Month Avg. Minus Min/Max
Your scenario: get the average result from last 7 month, exclude current month, previous month, min and max amount. Logic : summary records...
Read more >HTML attribute: min - HTML: HyperText Markup Language
The min attribute defines the minimum value that is acceptable and valid for the input containing the attribute. If the value of the...
Read more >Excel OFFSET function Explained in Simple Steps - XelPlus
OFFSET is a great formula whenever you have dynamic ranges involved. Some examples are: Calculating the average of the last three months when...
Read more >The I Bond Rate Fell Below 7%. We Answer Your Questions
Yes, you and your partner could each buy $10,000 worth of I bonds. That's the maximum amount you can buy in electronic bonds...
Read more >DATEADD function - Amazon Redshift - AWS Documentation
The following example adds 30 minutes to a date value that doesn't specify a ... ADD_MONTHS: If the date you are adding to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Further analysis.
So this case arises when the start and end dates are both less than the min date. in that case, last month or any other range doesn’t make any sense. Ideally the option should not even be enabled because those dates don’t exist based on restrictions.
Can we somehow disable a preset option if…
Thanks so much for being such prompt! 😃