[solved] Calendaring customization [highlighting the current month] |
11-25-2016, 08:57 PM
(This post was last modified: 11-27-2016, 05:37 AM by BabalooAye. Edit Reason: Marking post as solved )
I made a method that writes a view with a calendar table which shows all months of a year using the calendaring class. It works as well, and returns this:
![]() But I didn't found a way to highlight only the current month using a template in the calendaring class. I tried to modify the default template but it doesn't work because when I change the class of '{heading_title_cell}<th colspan="{colspan}">{heading}</th>{/heading_title_cell}', it modifies all the month's labels like this: ![]() I'm using the default methods from the basic class tutorial. Any suggestion?
Create a method to check the month and then a method to highlight the current month, you may want to create a MY_ class for this.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(11-26-2016, 06:00 AM)InsiteFX Wrote: Create a method to check the month and then a method to highlight the current month, you may want to create a MY_ class for this. You mean a function that returns the table array template depending on the month and year that was set? Something like a helper function?
Yes, you can also extend the Calendar library with MY_Calendar
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
11-26-2016, 12:29 PM
(This post was last modified: 11-28-2016, 09:07 AM by BabalooAye. Edit Reason: Include image to improve explanation ) (11-26-2016, 11:35 AM)InsiteFX Wrote: Yes, you can also extend the Calendar library with MY_Calendar I extended the CI_Calendar and made the generate() method pass his $month variable to the parse_template($cur_month) method, then, he uses $cur_month to apply an exception and assign the class="info" to heading_row_start: PHP Code: if (is_string($this->template)) { Result: ![]() |
Welcome Guest, Not a member yet? Register Sign In |