Advantages of the use of test-day records for genetic evaluation of dairy cattle are now widely accepted. In particular, longitudinal models such as random regression avoid using ad hoc extrapolation procedures to reconstruct complete lactations as they provide individual predictions even for incomplete data. However, these predictions and parameter estimates obtained in the model do not take into account the lactation length. This can be an important drawback for phenotypic and genetic analysis of milk production of cows with shorter lactations. The aim of this paper is to propose a methodology that would correct these predictions, weighting them by the probability at each point in time of each cow being dried off. The proposed procedure is easy to implement and calculations are fast to compute. A simulation study and an application on real data for daily milk records show that the proposed methodology provides a more accurate estimation for individual cumulative production as well as genetic values, and avoids predicting negative productions at the end of the lactation as is often the case with random regression models.