P-Schedule dayRender

UI Components for Angular
Post Reply
jayendran
Posts: 7
Joined: 03 May 2017, 18:17

15 May 2017, 21:19

Can any one implemented DayRender? if so please pass me the example.

I tried this in Angular 2.0 (typeScript) but its not working. Date and cell are not identified.

this.dayRender(date, cell) {
cell.css("background-color", "yellow");
}

jayendran
Posts: 7
Joined: 03 May 2017, 18:17

17 May 2017, 22:24

Any help will be appreciated. Any one implemented dayRender?

if not how do we set valid date range in the calendar?

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

18 May 2017, 03:13

In case of attributes, PrimeNG schedule just passes all the config details to the full calendar options. It should work the same way as full calendar dayrender function.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

jayendran
Posts: 7
Joined: 03 May 2017, 18:17

18 May 2017, 05:44

Full Calendar documentation has this.

function( date, cell ) { }.

How can i get access to parameters (date and cell) in Angular type script file?

User avatar
sudheer
PrimeFaces Core Developer
Posts: 4345
Joined: 16 Oct 2011, 19:19
Location: Singapore

18 May 2017, 07:56

You just need to call the function like [dayRender]="dayRender" .That's it.
Author,Speaker
https://twitter.com/sudheerjonna
Github: https://github.com/sudheerj
Website http://sudheerjonna.com/

___________________
Sudheer Jonna

biven
Posts: 2
Joined: 16 Nov 2017, 11:43

16 Nov 2017, 11:48

I use Angular 4 and "primeng": "^4.1.0". Just using

Code: Select all

[dayRender]="dayRender"
...
dayRender(date: any, cell: any): void {
    
  }
doesn't get any result. Both params are undefined. How should it work?

biven
Posts: 2
Joined: 16 Nov 2017, 11:43

17 Nov 2017, 16:53

biven wrote:
16 Nov 2017, 11:48
I use Angular 4 and "primeng": "^4.1.0". Just using

Code: Select all

[dayRender]="dayRender"
...
dayRender(date: any, cell: any): void {
    
  }
doesn't get any result. Both params are undefined. How should it work?
I found my issue. Documentations says: This callback lets you modify day cells that are part of the month, basicWeek, and basicDay views, but i tried to use it with agendaWeek and agendaDay. So, additional question: does any mechanism have for handling cells rendering on agendaWeek and agendaDay views?

giammanet
Posts: 1
Joined: 04 Feb 2019, 18:17

04 Feb 2019, 18:25

i use primefaces in JSF projects.

in my case, suppose that i've declared my schedule this way:

<p:schedule id="schedule" .... (other params..)

in a javascript block i call this:


$("#schedule").fullCalendar({
dayRender: function (date, cell) {
cell.css("background-color", "red");
}
});

yigitfindikli
Posts: 449
Joined: 08 Aug 2018, 14:09

05 Feb 2019, 09:20

p-schedule is deprecated. You can use p-fullCalendar. You can more info in http://primefaces.org/primeng/#/fullcalendar .

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: Thomasquaps and 11 guests