Managing availability of ListIt items - a mashup

I have released a new version of the JSAvailability module. It has completely changed and I believe it’s worth a bit of explanation. Here’s a brief history.

When I was working on a website for holiday rentals 2.5 years ago I created a module that allowed a simple management of the availability of properties on this site. The front-end showed a simple calendar (screenshot below) and the back-end looked pretty much the same.

Occupancies could be set by simply selecting start and end date in the calendar.

Well, my JavaScript that time was not exactly outstanding, the module was never really stable and sometime it was marked stale. Shame about the good idea behind it, I thought to myself the other day. A complete rewrite pondering I came to the conclusion that such a management system would have to take much other data as well and the best thing to go with is a custom field type for ListItExtended (hereafter referred to as LI).

How to use the module in its new version

Sorry, but let's just forget upgrading from previous versions. It’s impossible! For all new installations it's really simple though.

Install JSAvailability and LI. Go to LI and in the Field Definitions tab push Scan Field Definitions. Create your LI instance ListIt2Availability and here you go! You are now able to create custom fields of type Availability Calendar.

To output the same calendar view on the ListIt detail page simply insert this to the end of your detail template and replace the field id:

{JSAvailability field=$item->fielddefs[1]}

This module is made using clndr.js.