pseudo code for date validation

wrote out pseudo code for a possible date validation function
mainly to have something to save to merge branches.
adding window reloads and working on edit

edit is still assigning new key code instead of keeping one.
change/add

changed if (!key) to try to fix the edit problem…
added comments explaining problem.