Better date formatting handling

Why two times "max" in that array ?