rebuild date limit function