fix some bugs in normalizing lastDay