Fixed context in formatDate