﻿


function EventOccasion(location, startDate, stopDate)
{
	this.Location = location;
	this.StartDate = startDate;
	this.StopDate = stopDate;

	this.GetDatePeriod = function ()
	{
		if (this.StartDate == null)
			return null;
		else if (this.StopDate == null)
			return TimeDate.GetLongDate(this.StartDate);
		else
		{
			return TimeDate.GetLongDateSpan(this.StartDate, this.StopDate);
		}
	}
}

EventOccasion.IsHistoric = function (occasion)
{
	var hasNoDate = true;
	if (occasion.StartDate != null)
	{
		hasNoDate = false;
		if (occasion.StopDate != null)
		{
			if (TimeDate.Compare(occasion.StopDate, Network.ServerTime) == 1)
				return false;
		}
		else if (TimeDate.Compare(occasion.StartDate, Network.ServerTime) == 1)
			return false;
	}
	if (hasNoDate)
		return false;
	return true;
}
