Fix incomplete date function