Fixed shift allocation.

It was not calculating the correct dates so rooms were wrongly shown as occupied.
newEmail now accepts path parameters
Fixed bug with date serialization

A bug submited 'null' values to the database which caused the
application to crash when they were fetched.
Also, we added a check on input to prevent old dates.
Merge pull request #618 from cfscosta/master

Fixed shift allocation.