Migrated format_date and format_datetime function to use js strftime