Click or drag to resize

CalendarWeb Class

Data contract Rental calendar and possible arrival/departure dates.

The primary goal of an arrival and departure calendar is to correctly identify on which days what vacation types (booking lengths) are available.

RentalObjectCalendarWeb.ArrivalDays and RentalObjectCalendarWeb.DepartureDays contains possible arrival and departure days for the following vacation types:

  • Standard vacation (A): 7, 14, 21 or 28 days
  • Optional Arrival (O): 7-28 days
  • Multi Week Discount (M): 14-28 days
  • Short Stay (S): 2-6 days

The calendar also contains the following vacancy details

  • A: Free and available standard vacation arrival day (see above)
  • a: Available
  • b: blocked. Not available, but a blocked day should not count against the winter 13 week (max) rental rule
  • B: Booked
If the rental object is blocked for winter rental then the winter period will be marked as blocked (b) on both calendars.

To correctly parse the calendar the following steps should be taken: Start by identifying an arrival day of interest on the arrival calendar. To do this, use the offset date on the calendar and calculate how many groups (days) to skip to find the group of interest. Once found, the contents of the arrival day group can be used to calculate allowed arrival days. The goal is to find out what lengths between 2 and 28 days are possible for this specific arrival day.

Here are the possible values to help determine an allowed departure day:

  • B or b: No arrival is possible on this date.
Standard vacation (A):
  • Allowed length is 7, 14, 21 or 28 days.
  • The arrival day must contain an A on the arrival calendar.
  • The departure day must contain an A on the departure calendar.
  • Every day in between must contain an uninterrupted A/a on either the arrival or departure calendar.*
Optional Arrival (O):
  • Allowed length is between 7-28 days.
  • The arrival day must contain an O on the arrival calendar.
  • The departure day must contain an O on the departure calendar.
  • Every day in between must contain an uninterrupted O on either the arrival or departure calendar.*
Short Stay (S):
  • Allowed length is between 2-6 days.
  • The arrival day must contain an S on the arrival calendar.
  • The departure day must contain an S on the departure calendar.
  • Every day in between must contain an uninterrupted S on either the arrival or departure calendar.*
Multi week discount (M):
  • Allowed length is 14, 21 and 28 days.
  • The arrival day must contain an M on the arrival calendar.
  • The departure day must contain an M on the departure calendar.
  • Every day in between must contain an uninterrupted M on either the arrival or departure calendar and A/a.*
  • For lengths other than whole weeks (15-20 and 22-27 days) every day in between must contain an uninterrupted M on either the arrival or departure calendar and O. *

*When checking if a character is either on the arrival or departure calendar, start by looping the arrival calendar and check for that character. If a day is reached where the characters is no longer there, then continue from that day on the departure calendar, and continue checking for that character until the desired departure date is reached.

Please note
Please be aware that the calendar string format described above is obsolete and is only available to avoid breaking the contract with old client proxies.
Please use the new duration based format in stead. The description of this duration based format can be found in the comments to the field ArrivalDays
If the field IncludeCalendarDurations is set to true, a CalendarWeb instance containing the duration based format, will be returned in the field CalendarDurations. The field Calendar always contains the old obsolete format.

Inheritance Hierarchy
SystemObject
  DataContractBase
    Tse.EasyBook.Server.DataContractsCalendarWeb

Namespace:  Tse.EasyBook.Server.DataContracts
Assembly:  Tse.EasyBook.Server.DataContracts (in Tse.EasyBook.Server.DataContracts.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class CalendarWeb : DataContractBase

The CalendarWeb type exposes the following members.

Constructors
  NameDescription
Public methodCalendarWeb
Top
Properties
  NameDescription
Public propertyArrivalDays
If the field DurationFormat either is absent or contains the value false, then this field contains a string formatted as described in the comments on the class for this field.
Otherwise this field contains a string containing the new duration based calender string format.
For the duration based format each day has one of the following 4 values:
  • Value 1:A??????????
  • Value 2:a
  • Value 3:B
  • Value 4:b
Value 1 consists of the upper-case letter A followed by integer number. Value 1 represent a day where arrival is possible. The reverse one-based position of the bits in the integer number, represent the possible durations in days for rental periods with arrival on this day. So the integer number 96 converts to the binary number 1100000 and the reverse of that is 0000011. Therefor durations of either 6 or 7 days are possible for arrivals on this day. The maximum value of this integer number is 4294967295(32 bits).
Value 2 represent a vacant day that is available for booking, but where arrival is NOT possible.
Value 3 and 4 represent a occupied day that is NOT available for booking.
All the days between the date Offset and the date of EndDate, both included, are represented by one of the 4 values followed by a comma.
Example of a string value for ArrivalDays: A12384,a,a,a,a,a,a,A96,a,a,a,a,a,a,b,b
Public propertyDepartureDays
If the field DurationFormat either is absent or contains the value false, then this field contains a string formatted as described in comments to the class CalendarWeb. Otherwise this field is empty.
Public propertyDurationFormat
If true the field ArrivalDays contains a duration calendar string format and the field DepartureDays is null. Otherwise these fields contains the normal calendar string format.
Public propertyEndDate
Property StartDateOfDays
Public propertyOffset
Property StartDateOfDays
Top
Methods
  NameDescription
Public methodStatic memberGetVacancyTypesDescription
Get description of possible vacancy type codes
Top
Remarks
Please note
Please be aware that the calendar string format described in the comments to this class is obsolete and is only available to avoid breaking the contract with old client proxies.
Please use the new duration based format in stead. The description of this duration based format can be found in the comments to the field ArrivalDays If the field IncludeCalendarDurations is set to true, a CalendarWeb instance containing the duration based format, will be returned in the field CalendarDurations. The field Calendar always contains the old obsolete format.
See Also