Limit range if some date in range is disabled - react-day-picker

I have a daypicker with mode=range and disabled dates. If I want to select a range that has a disabled day in it, it is selected correctly and it is not what I expect.
I want to avoid that, maybe reducing the range a day before disabled. Is this possible with some flag?
<DayPicker
disabled={disabledDates}
fromDate={new Date()}
mode="range"
numberOfMonths={2}
selected={range}
onSelect={handleRange}
/>

Related

SSRS Report Builder: Default Value of Date Parameter Unresponsive

I have a report that has Period, From Date, and To Date parameters. The Period is the number of months that should be between the From Date and To Date parameters by default. The From Date defaults to the system date.
The functionality I need is that if someone should change the From Date or Period parameters, the To Date should update automatically to the correct value. I also need to allow all three parameters to be manually alterable by the end user.
The default for the From Date works fine.
So far I have tried the following:
Using an SSRS expression to set the To Date Default value. This works correctly when I put a value into the Period parameter, however when I change that value the To Date does not update.
Using a dataset to set the To Date Default value. This has the same result as (1).
Using a dataset to set the Default and Available values to the calculated value. This updates correctly, however it becomes a none interactive parameter.
Using a helper parameter, with Default and Available values set as (3), then using this parameter as the default for To Date. This works correctly, producing the functionality I want, but it leaves a none interactive parameter on the parameters list, which is aesthetically undesirable.
Doing as (4), but making the helper parameter hidden. This reverts to the same functionality as (1).
Doing as (4), but making the parameter internal. This reverts to the same functionality as (1).
All parameters are set to Always Refresh. I don't understand why hiding the parameter makes it work differently, and I've run out of ideas for how to do this. Any suggestions would be very much appreciated.

Kibana KQL search saved with time range

I'm creating a saved search using Kibana Discover. On screen I can select the time range manually (default is "Last 15 minutes"). If I select "Last 24 hours" and Refresh the search, it works fine. However, when I save the search, the time range information is not saved. Whenever I open Kibana Discover and open my saved search, the time range is always the default (last 15 minutes).
I tried adding different conditions (below) to my KQL query, to no avail. :^(
and #timestamp >= "now-24h"
and #timestamp >= now-24h
and timestamp >= "now-24h"
and #timestamp >= "now-1d/d"
etc.
I also tried to "Add filter" using the #timestamp field. The only operators available are: is not, is one of, is not one of, is between, is not between, exists, does not exist.
So, I tried between now-24h and now. Yet, no results match the criteria.
However, if I manually change the time range to say, Last 30 days, then my filter works!
Question
How do I include the time range, say last 24 hours, in my KQL saved search so that it overrides the time range that is manually set on screen?
(Motivation: I don't want to change the default manual time range to be larger than the range used in all saved searches. Also, I want to make the saved searches available to a support team with minimal manual configuration.)
(I'm using Kibana v7.10.0.)

Issue with date checking

In Apex app I've a region called Person on a page. Inside a region there is a masked date picker. I have a task to validate the date of birth. So, the date of birth could not be less 1900 year. In "Conditions" section i'd been trying to write an pl/sql expression:
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01.01.1900', 'MM-DD-YYYY')
but it doesn't work. What am I doing wrong?
You put it to wrong place - "Condition" is used to decide whether an item will (or will not) be rendered on the screen.
Validation should be put into ... well, validation (obviously).
right-click the P1002_CONTR_BIRTH_DATE date picker item
choose "Create Validation"
set its type to "PL/SQL function (returning error text)
use such a code (presuming that you set the date picker format mask to MM-DD-YYYY):
if to_date(:P1002_CONTR_BIRTH_DATE, 'mm-dd-yyyy') < date '1900-01-01' then
return ('Error - can not set it to before 01-01-1900');
end if;
set it to fire when SUBMIT button is pressed
Alternatively (and way simpler) would be to open date picker item's property palette, navigate to its "Minimum date" property and put (for example) -120y in there which will allow dates that are higher than sysdate - 120 years (today, Apex would raise the
Birth date is less than specified minimum date 04-15-1898'
which isn't exactly "1900", but - you can easily calculate it, right? Also, -120y is somewhat more flexible than fixed year 1900.
Now you have two options, pick the one that suits you best.
TO_DATE() method is to convert a string to date, the string format should be the same as format_mask.
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01-01-1900', 'MM-DD-YYYY')
or
TRUNC(TO_DATE(:P1002_CONTR_BIRTH_DATE, 'MM-DD-YYYY')) > TO_DATE('01.01.1900', 'MM.DD.YYYY')
and also make sure :P1002_CONTR_BIRTH_DATE is also the same as format.
For detail

Cognos 10.2 - date range default earliest vs today

Very simple question (hopefully) but I can't find the answer anywhere. I have two seemingly identical date prompts for optional date ranges. One defaults to today's date. The other defaults to 'earliest' and 'latest'. But I can't for the life of me find the setting that controls this.
(I'm not trying to do anything advanced such as dynamical defaults, using javascript.)
Please help. Thanks.
A single-select date prompt with the Required property set to 'No' and the Range property set to 'Yes' will show the Earliest and Latest radio buttons and have them selected as default. When the Required property is set to 'Yes' the date prompts default to the current date. Thus, your two date prompts likely have different settings for the Required property.

What is the difference between Flex mx:DateField disabledRanges = "" and selectableRange = ""?

I Want a flex date field with particular selectable range only.
I could there are similar properties of mx:DateField to restrict the selectable date range. that are
<mx:DateField disabledRanges="{[{rangeEnd: new Date()}]}"/>
and
<mx:DateField selectableRange="{{rangeStart : new Date()}}" y="100"/>
so i would like to know what is the difference between above two properties and in which case have to use disabledRanges and selectableRange.
disabledRanges allows you to define multiple date ranges to exclude from being selected.[1]
selectableRange allows you to define a single date range to include for selection.[2]
The difference is small but powerful, the ability to define multiple exclusions allows much more customisation.
Imagine you wanted to only allow someone to pick a date in this month, that easy with selectableRange, but imagine you also wanted to exclude all weekends and national holidays? You can't do that with one inclusive date range, you need multiple exclusions.
This properties are opposite. With disabledRanges you could disable some date (dates) from choosing (and other dates will be available to user) and with selectableRange you could set date (dates) that only available (and other dates will be disabled for user).
disabledRanges
selectableRange

Resources