function Fixture(date, team, venue, scoreHome, scoreAway, report) {
  this.date = date;
  this.team = team;
  this.venue = venue;
  this.scoreHome = scoreHome;
  this.scoreAway = scoreAway;
  this.report = report;
}

Fixture.prototype.createDate = function(englishDate) {
  var dd = englishDate.substring(0, 2);
  var mm = (englishDate.substring(3, 5) - 1);
  var yy = englishDate.substring(6, 10);
  var yankDate = new Date(yy, mm, dd);
  return yankDate;
}

Fixture.prototype.getDate = function() {
  var newDate = this.createDate(this.date);
  return newDate.shortFormat();
}

Fixture.prototype.getTeam = function() {
  return this.team;
}

Fixture.prototype.getVenue = function() {
  return this.venue;
}

Fixture.prototype.getScoreHome = function() {
  return this.scoreHome;
}

Fixture.prototype.getScoreAway = function() {
  return this.scoreAway;
}

Fixture.prototype.getReport = function() {
  if (this.report == "Replace this text with report")
    return "";
  return this.report;
}

Fixture.prototype.toString = function() {
  var homeTeam = "";
  var awayTeam = "";
  if (this.venue == "Home")
  {
    homeTeam = "Queens";
    awayTeam = this.team;
  }
  else {
    homeTeam = this.team;
    awayTeam = "Queens";
  }
  var text = "<h4>";
  text += "[" + this.getDate() + "] ";
  text += homeTeam + " " + this.getScoreHome();
  text += " - " + awayTeam + " " + this.getScoreAway();
  text += "</h4>";
  text += "<p>";
  text += this.getReport();
  text += "</p>";
  return text;
}

Fixture.fixtureSortResults = function(fix1, fix2) {
  return fix1.createDate(fix1.date) - fix2.createDate(fix2.date);
};

Fixture.fixtureSortReports = function(fix1, fix2) {
  return fix2.createDate(fix2.date) - fix1.createDate(fix1.date);
};