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

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

Related

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.

How to set the entire date/time for an instance?

I'm adding an extension function to Moment and it needs to change the entire Moment instance to a new date/time value. However, the available Set methods only seem to allow setting specific units (ie. day, month, hour, second).
I understand that it would probably be possible to do:
this.set('year', year);
this.set('month', month);
...
but this seems ugly and possibly error-prone (if the values adjust for temporarily invalid date/times).
You can get Date from that moment values and then use setMinutes, setYear, setMonth etc. functions on that date object.

Set the year as prefix in Numbersequences

In AX 2012 I want to add the year (e.g. 2011) as prefix in the ID field.
For instance I create a new customer in AX. The ID of this new customer should be like: 2013-00000123
Is it possible to set the year in the segments instead of coding this.
How can I achieve this? Thank you in advance.
If the "fixed" solution proposed by Sshaheen don't suit your needs, and you really need to get a dynamic value for the year, the only suitable solution if to develop it through X++ code, in the CustTable table or class (just find where a new sequence number is obtained).
Anyway, I'll recommend using a constant value on the number sequence, as Sshaheen states.
The simplest way to do this would be to create a new number sequence and make two segments, one that is constant (the year 2013), and one that is alphanumeric. Then, go to the AR parameters and set Customers to your new number sequence. However, you would need to do this at the first of every year to change the constant.

Disable dates outside a range in Infragistics WebMonthCalendar control

I want to disable dates which are not in between RangeMin and RangeMax from a selectedDates collection in an Infragistics WebMonthCalendar control, I have researched a bit but not found any clue.
Which WebMonthCalendar property should I have use?
In the WebMonthCalendar, you have two properties named MinDate and MaxDate.
They get or set the maximum and minimum date that can be selected in the calendar.
I don't know it they disable the dates outside their values, please check if this could be your answer.

Resources