Fixing the calculation of the dates out of the current date.
Last night and/ or next night
Removing useless code
Removing useless code
Fixing dates