From b60712b8868d08d61c61bd7384f5ab429f43e490 Mon Sep 17 00:00:00 2001
From: Manuel Herrmann <it@icetruck.de>
Date: Fri, 26 Sep 2014 20:29:54 +0200
Subject: [PATCH] story "impossible dates" existence fix for removing
 "impossible dates" and a very long commit message

---
 registration-system/view/js/story.js | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/registration-system/view/js/story.js b/registration-system/view/js/story.js
index 1fc05aa..f4c0cbc 100644
--- a/registration-system/view/js/story.js
+++ b/registration-system/view/js/story.js
@@ -243,7 +243,11 @@ Story.prototype.initTravelStart = function()
 		$(this).stop(true, true).effect("highlight");
 	});
 
-	this.travelStartDate = this.addComboBox(this.travelStartTicket, "Datum", "anday", [""].concat(comm_get_possible_dates()), 115, 70); // @TODO: get date options from php
+	var possible_dates = comm_get_possible_dates();
+	possible_dates.pop(); // remove last
+	possible_dates.unshift(""); // push_front(...)
+
+	this.travelStartDate = this.addComboBox(this.travelStartTicket, "Datum", "anday", possible_dates, 115, 70); // @TODO: get date options from php
 	this.travelStartTicket.append('<div style="position: absolute; left: 65px; top: 95px">Typ</div>');
 	this.travelStartTicket.append('<div style="position: absolute; left: 115px; top: 95px" id="travelStartType">------</div>');
 	this.travelStartDate.change(function()
@@ -373,7 +377,11 @@ Story.prototype.initTravelEnd = function()
 		$(this).stop(true, true).effect("highlight");
 	});
 
-	this.travelEndDate = this.addComboBox(this.travelEndTicket, "Datum", "abday", [""].concat(comm_get_possible_dates()), 115, 70); // @TODO: get date options from php
+	var possible_dates = comm_get_possible_dates();
+	possible_dates.shift(); // remove first
+	possible_dates.unshift(""); // push_front(...)
+
+	this.travelEndDate = this.addComboBox(this.travelEndTicket, "Datum", "abday", possible_dates, 115, 70); // @TODO: get date options from php
 	this.travelEndTicket.append('<div style="position: absolute; left: 65px; top: 95px">Typ</div>');
 	this.travelEndTicket.append('<div style="position: absolute; left: 115px; top: 95px" id="travelEndType">------</div>');
 	this.travelEndDate.change(function()
-- 
GitLab