I need to show a date in a language defined by a locale that is stored in a string variable named "locale".
new SimpleDateFormat("EEEE, MMMM d, YYYY", Locale.forLanguageTag("es-MX")).format(new Date("09/01/2016"))
This code returns "jueves, septiembre 1, 2016" which is what I need.
However, if I store the "es-MX" in a simple string variable and replace the hard-coded locale with the variable, it returns NULL:
new SimpleDateFormat("EEEE, MMMM d, YYYY", Locale.forLanguageTag($V{locale})).format(new Date("09/01/2016"))
I have also replaced the Locale.forLanguageTag("es-MX") with new Locale("es", "MX") but get the same result.
Does anyone know of a way to accomplish this?
Thanks,
Danny