﻿// adds n days to the date and returns a new date object
function AddDays(myDate,days)
{
	return new Date(myDate.getTime()+days*24*60*60*1000);
}

// parses a string in the dd.mm.yy(yy) format and returns a new date
function ParseDate(date)
{
	var segments = date.split('.');
	return new Date(segments[2],segments[1]-1,segments[0]);
}

// formats a date to a dd.mm.yyyy formatted string
function DateToShortDateString(date)
{
	var s = date.getDate() + "." + (date.getMonth() + 1) + "." + (date.getYear()<2000 ? date.getYear()+1900 : date.getYear());
	return s;
}


