Add locale support to date function