luisfarzati / ng-bs-daterangepicker

AngularJS directive for bootstrap-daterangepicker
http://luisfarzati.github.io/ng-bs-daterangepicker/
MIT License
246 stars 167 forks source link

How to set field to be empty by default? #55

Open jeserkin opened 9 years ago

jeserkin commented 9 years ago

Need field with range to be empty at first. Later on, when one selects something, then dates could appear. Is it possible?

thanhtung1509 commented 9 years ago

I have the same issue with #jeserkin. I have a form with a daterange picker to be empty at first and validate it when i submit my form. Would you please to support this function?

jeserkin commented 9 years ago

I don't like to publish my stuff in someone else repo, but seems there hasn't been much progres lately. So I've gathered diff. solutions for daterange picker and tried to create one with all the best features from others + plus something from me. Enough said: https://github.com/jeserkin/nDaterangepicker

alanjames1987 commented 9 years ago

@jeserkin Please submit any pull request you want. I am one of the new maintainers of this repo and I will accept the PR if it makes sense.

HaroldZhang91 commented 9 years ago

@alanjames1987 it still have bug,ng-model with range is abnormal at first. it set ng-mode first time and return .the range present nothing,but ng-model has value .

amer4 commented 9 years ago

Hi is this issue resolved??... I have implemented this directive in my project and I'm using this to filter search results not being able to intialize to null is giving me problems

HaroldZhang91 commented 9 years ago

@amer4 remark the following code will fix the bug if (!$scope[modelValue] || (!$scope[modelValue].startDate)) { //ngModel.$setViewValue({ // startDate: moment().startOf('day'), // endDate: moment().startOf('day') //}); return; }