added method to get the current date in javascript