Added javascript function for getting date