POC:Compute automatically length of leave