I'm trying to have a datepicker popup with an extra button. I can add the extra button with a custom template. That part works, but now i want to select a date when I click on the button. I already tried to use select('2018-03-15', $event) but that does not work. I think the select needs a real date object but how can I achieve that without needing to edit the directive code?
Asked
Active
Viewed 26 times
0
-
can you try passing the `new date()` to the event? – swetansh kumar Feb 16 '18 at 07:12
-
@swetanshkumar then i get an error – Jurgen Vandw Feb 16 '18 at 07:15
-
can you tell me the datepicker which you are using? – swetansh kumar Feb 16 '18 at 07:16
-
@swetanshkumar this one: https://angular-ui.github.io/bootstrap/#!#datepickerPopup In that popup I've added an extra button and then I want to select a specific date in the calendar when I press that button – Jurgen Vandw Feb 16 '18 at 07:22
-
@swetanshkumar I made a plunker for it https://plnkr.co/edit/aftBiqjytIiwIJAbiuhx the set max date is selecting the correct date in the date picker, but is not setting it in the text field... – Jurgen Vandw Feb 16 '18 at 10:12
-
I think the method `select` is defined already in their directive. So its not string which you are passing. Need to study more for finding the exact answer. – swetansh kumar Feb 16 '18 at 10:35
-
@swetanshkumar i'm trying to use that method to select the date, in the datepicker it succeeds, but it does not update my model. I think because of the string not being a date... – Jurgen Vandw Feb 16 '18 at 10:44
-
yes thats right I am getting the same so I am looking for the other way around – swetansh kumar Feb 16 '18 at 11:09