Fix spelling error.

It's unknown not uknown.
Couple of logic fixes

Thats confusing.. Sunday is index 1 in the db, not the input form!
Also add nl2br() for the content
Fix EOL dates bug.

No need for a loop and the first array element should be used for the ternary,
not the second.
Fix another EOL date bug. Wrong values for the periods.
Fix EOL dates DateTime constructor bug. $detail['date'] is a Unix timestamp
and not a formated date. My mistake.