fixed bugs to get prev or next date amalan