![]() |
[solved] Calendaring customization [highlighting the current month] - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: [solved] Calendaring customization [highlighting the current month] (/showthread.php?tid=66730) |
[solved] Calendaring customization [highlighting the current month] - BabalooAye - 11-25-2016 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? RE: Calendaring customization [highlighting the current month] - InsiteFX - 11-26-2016 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. RE: Calendaring customization [highlighting the current month] - BabalooAye - 11-26-2016 (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? RE: Calendaring customization [highlighting the current month] - InsiteFX - 11-26-2016 Yes, you can also extend the Calendar library with MY_Calendar RE: Calendaring customization [highlighting the current month] - BabalooAye - 11-26-2016 (11-26-2016, 11:35 AM)InsiteFX Wrote: Yes, you can also extend the Calendar library with MY_Calendar Well, I guess that extending is the right way because the template array is passed on CI_Calendar loading. Thanks, I'll try here. ![]() RE: Calendaring customization [highlighting the current month] - BabalooAye - 11-26-2016 (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: ![]() |