JS: fixing bug not allowing date to be printed if date_due