|
Comments
Did you read today's front page stories & breaking news?
SYS-CON.TV
|
Integrating ZK Calendar with a database
Jul. 31, 2009 03:42 AM
Last month I posted a Small Talk discussing the use of ZK Calendar with a database. Since then I have been working closely with ZK Calendar and thought I would share another way of achieving the same effect. Extending ZK Calendar’s AbstractCalendarModelThe key is to extend the AbstractCalendarModel and override the get function. This function is used to retrieve the events from the selected model, in this case the underlying model architecture is a database. The ‘get’ functionThe get function takes the following parameters:
The two Date objects denote the start and end dates respectively whereas the RenderContext contains a function getTimeZone(). This function is used to retrieve the calendar’s TimeZone which is used to align the Date object’s time with the database’s timezone. The code
The above code demonstrates how we have implemented the retrieval. You can download the Small Talk’s code to give you a better understanding of how the database interaction was implemented. In this case I added a new function which will retrieve all the database entries between the two dates, I will not show how to do this in this blog post. However, by using the Small Talk’s code as an example you can see that the time is stored as an integer value (the time since Unix Epoch), thus we can easily retrieve the events between two dates using integer comparisons. Integrating ZK Calendar with a database is a post from: Timothy Clare Latest Cloud Developer Stories
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
|
SYS-CON Featured Whitepapers
Most Read This Week
Breaking Cloud Computing News
|
|||||||||||||||||||||||||||||||||||||||||||||||||