fixed bug of generate dates