Hi everybody,
i need some help with the calendar-functionality and the option "range".
I don´t understand, how i get the two dates into in array without using the [(ngModel)]?
p-calendar and range
I want to do a Datepicker with a inline Calendar (have a look at the link: https://www.primefaces.org/primeng/#/calendar), where i can select a range.
I have created a service that sends the selected data to a component (not a Mother-Child-Relation, so Binding doesn´t work).
I do not know how it works without the ng-Model. I just want to have the range data in an array that will be send with the created service function.
Instead of [(ngModel)], you can do [ngModel] and (ngModelChange) then bind (ngModelChange) to a method in your component that is going to handle the data from p-calendar. If it's not inside of a Form (which is a standalone DatePicker just to get you a Date range), then ngModel and ngModelChange would help you achieve what you need. Other than that, you need to elaborate more on your use-case so I can help you.
That was the solution! Thank you very much!ctran2428 wrote: ↑18 Jan 2018, 19:27Instead of [(ngModel)], you can do [ngModel] and (ngModelChange) then bind (ngModelChange) to a method in your component that is going to handle the data from p-calendar. If it's not inside of a Form (which is a standalone DatePicker just to get you a Date range), then ngModel and ngModelChange would help you achieve what you need. Other than that, you need to elaborate more on your use-case so I can help you.
My question is similar. Right now, I have multiple inline calendars on my page. The calendar component does not allow me to select dates that range across two consecutive months. The range feature allows you to select across multiple months in the same calendar. That means if I have Jan, Feb, Mar..., if I select a range from Jan to Feb, the calendar now reads Feb, Feb, Mar... If I change the selection type and handle the highlighting manually, how to I update the model?
-
- Information
-
Who is online
Users browsing this forum: No registered users and 17 guests