mominsamir / smDateTimeRangePicker

Angular Material Date Picker, DateTime Picker, Date Range Picker, Date Time range picker
http://mominsamir.github.io/smDateTimeRangePicker/
MIT License
130 stars 50 forks source link

min-date and max-date issue #164

Open vamsideepak opened 6 years ago

vamsideepak commented 6 years ago

in min-date and max-date angularjs $scope variable's values are not accessing(even javascript variable too) . please help me in this if any one know it.

oscar09 commented 6 years ago

can you elaborate what the problem is or provide a plunker with the error?

vamsideepak commented 6 years ago

Hai oscar09 first of all thank u for responding. i just need to access controller scope value in mindate and maxdate. but in this sm date tie picker we are not accessing that .

oscar09 commented 6 years ago

Do you want to access the mindate & maxdate with the controller to make it dynamic? If so, I believe that will fall into the "new feature" category. Currently mindate & maxdate values are set at initialization and cannot be changed after that.

vamsideepak commented 6 years ago

thank u bro . do you know how to set custom range only in range picker remaining has to be disappear (i mean today, last 7 days, last month etc...). i done this by commenting the code today, last 7 days..etc. but that's not a good level. is there any attribute to show only custom range start and end dates.

oscar09 commented 6 years ago

As I understand, you want to modify the default set of date ranges (today, last 7 days, this month, etc). If that is the case, you can do it with the custom-list attrubute. It will look something like this:

<sm-range-picker-input
                fname="Date of Paya"
                label="Date of Paya"
                form="test"
                ng-model="vm.employee.default1dd"
                flex="50"
                format="DD-MM-YYYY"
                divider="To"
                week-start-day="Monday"
                custom-list="vm.overrideList"
                custom-to-home="true">
            </sm-range-picker-input>

in your controller:

vm.overrideList = [{
        position:1,
        label:'Custom',
        startDate: moment(),
        endDate: moment()
    }]

However, It seems to be broken. I will work on a fix and upload it during the weekend.

vamsideepak commented 6 years ago

thank you mr.oscar09 i will try now .