format code
fix issue when last two weights is on same date