Rebuild period state correctly when calling getMonthCells()
Add unit test for period state feature