updated login and added js date functions