Closed Devarajsingh89 closed 5 years ago
Hello @oscar09 , How are you? I need to apply dynamic validations on end date. Could you please help me with it?
what do you mean by dynamic validations? how are you planning to use it?
There is an option max-date=moment() which only allow selecting max date as today's date for the case of Range Picker. I need to apply max date validation for all the cases : Today Week Month Range How to achieve this?
And one more thing can I display only one option in date range picker?
Marked in blue.
I got something :
The issue has been fixed. You should be able to use the custom list in the followign way:
vm.customList = [
{
position: 0,
label: 'Holy Week',
startDate: moment('2019-04-14'),
endDate: moment('2019-04-20')
}
];
html attr:
custom-list="vm.customList"
and you will get something like this:
max-date property grays out the dates after the set max date. If you need to run specific validations (if the selected day is a weekend for example) you could do it in the oRangeSelect method. The returned objects are moment objects and it already has methods to check those kind of constraints.
max-date should take the date as moment or as max-date="11-10-2016" (assuming that you set the format as DD-MM-YYYY)
I'm trying to apply max date validation as :
Controller :
$scope.maxDate = 'MM/DD/YYYY';
View File :
max-date="moment(maxDate)"
Now it is not working. Any idea?
Moment js takes a date string and converts it to moment object. It should be able to parse a date that comes with the format mm/dd/yyyy. Which date are you passing ?
Hi,
smDateTimeRangePicker if i am selecting start date as for example "15-Mar-2018 01:01 AM" and if want to select end date as "15-Mar-2018 6:30 PM" its not allowing, the 15 in end date is disabled.