Fix bug of when first day or last day is sunday