Skip to content

Commit

Permalink
Fixing overlapping date issues so that only a single event is shown p…
Browse files Browse the repository at this point in the history
…er day. Fixing the way in which the number of days is calculated. Adding ability to add and remove reservations after calendar widget instantiation. Adding click handlers for dates without reservations. Updating resolveDates to check to start date, end date, and status from calendar date as well as reservation data. Support jquery datepicker 1.8.* which doesn't attach onclick handlers to dom. Fix for multiple states on single calendar day. Fix IE8 issue of appending div to input. Style past dates in calendar widget.
  • Loading branch information
pwhisenhunt committed Jun 24, 2013
1 parent 87a8cc9 commit 2cceeea
Show file tree
Hide file tree
Showing 7 changed files with 288 additions and 167 deletions.
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $('#myCalendar').calendar(options)

name | type | default | description
------------- |:-------------:|:-------------:|:--------------
url | String | ```''``` | The url to fetch data from. The default value is configured for SWIFT so feel free to override this to fit your url structure.
url | String | ```''``` | The url to fetch data from.
startOfWeek | Number | ```0``` | The day of the week for the calendar to start on. 0 is for Sunday, 1 is for Monday, etc.
language | Object | English US. See below for default. | The language keys to use for the datepicker. To pass in keys use the following format. Note that all keys must be provided if an alternative language is being used. They must also follow the correct ordering of months, days, etc.
defaultDate | <a href="http://api.jqueryui.com/datepicker/#option-defaultDate" alt="jQuery UI Datepicker Widget Documentation">See Docs</a> | todays date | The date to start the date picker on.
Expand Down Expand Up @@ -115,6 +115,34 @@ function(error) {
}
```

# Functions

name | options | description
------------- |:-------------:|:--------------
addReservations | Object | Used to add reservations to the calendar after instantiation. The object passed in requires the keys calendar and reservation, the same options passed into the calendar during instantiation. See the JSON Schema below for further details.
removeReservations | String or Array | Used to remove reservations by id from the calendar after instantiation. The parameter can either be a single reservation id or an array of reservation ids.

### Examples

```javascript
$('#myCalendar').calendar('addReservations', {
calendar: {
range: {
"startDate": '2013-01-02',
"endDate": '2013-01-05',
"reservationId": "inquiry"
}
},
reservations: {
"inquiry": {
"status": "INQUIRY"
}
}
});

$('#myCalendar').calendar('removeReservations', 'INQUIRY');
```

# Events

The Calendar widget allows users to pass in their own custom functions for on click of statuss, on error, and a custom changed event that is fired for when the start or end dates have changed for input field datepickers.
Expand Down
Loading

0 comments on commit 2cceeea

Please sign in to comment.