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

Accept moment objects in ngModel #101

Closed oscar09 closed 7 years ago

oscar09 commented 7 years ago

see discussion on #93

pablorsk commented 7 years ago

Great! Then the proposal is, in date-range-picker case, this:

ngModel = {
  startDateMoment: moment_object,
  endDateMoment: moment_object
}

Another proposal is use this:

ngModel = {
  startDate: moment_object,
  endDate: moment_object
}

Also, callback parameter is not very important now, becouse on callback is possible access to ngModel.

I'm working on a proposal, is not very difficult.

oscar09 commented 7 years ago

Actually it is already done (the changes on the callback). I will post them in a couple of mins, I am running some tests.

oscar09 commented 7 years ago

@pablorsk @mominsamir are you able to select previous dates on the demo page for the date range picker? I worked today on this task and noticed this issue. I am not sure if it is related to my forked version that is why I would like to double check with you guys. I pulled the latest changes found on master, and I did a quick debug and noticed that the error comes after commit 981604a7960914be0c046e8f9a09a761ab4ec464 . I still need to debug further to find out where the error was inserted.

oscar09 commented 7 years ago

Nevermind. It was a bug, it was fixed on pull request #119

oscar09 commented 7 years ago

This is done. I have tested locally and it worked fine. I have submitted a pull rquest, you can test it locally and if everything works fine, it can be merged into master.