function to formate the date
String dateStringFormatter(DateTime date) { var format = DateFormat.yMd(); var dateString = format.format(date); return dateString; }