Get Free Trial

localization and all uppercase

Resolved
Jimmy asked on September 16, 2021

Hello,
 
I have a localization on “monthsShort” Looking like this:

"monthsShort": {
"april": "Apr",
"august": "Aug",
"december": "Dec",
"february": "Feb",
"january": "Jan",
"july": "Jul",
"june": "Jun",
"march": "Mar",
"may": "Maj",
"november": "Nov",
"october": "Okt",
"september": "Sep"
}

And in my table all the months is all uppercase and it doesn’t work: https://jsfiddle.net/dwfxo3kr/ 
But if I change my localization to look like this: 

"monthsShort": {
"april": "APR",
"august": "AUG",
"december": "DEC",
"february": "FEB",
"january": "JAN",
"july": "JUL",
"june": "JUN",
"march": "MAR",
"may": "MAJ",
"november": "NOV",
"october": "OKT",
"september": "SEP"
}

It sorts the months in the correct order: https://jsfiddle.net/9wfymj7z/
Why do the case of the letters have a role to ply on this?
 
/Jimmy
 

1 answer

Public
Nadia Khodakivska Nadia Khodakivska Flexmonster September 17, 2021

Hello, Jimmy!
 
Thank you for writing to us.
 
JSON is case-sensitive which means values of months names in the localization should be the same as the values in your pivot’s data. In case you need both uppercase monthsShort and with a capital first letter, we can suggest using:

"months": {
"april": "APR",
"august": "AUG",
"december": "DEC",
"february": "FEB",
"january": "JAN",
"july": "JUL",
"june": "JUN",
"march": "MAR",
"may": "MAJ",
"november": "NOV",
"october": "OKT",
"september": "SEP"
},

"monthsShort": {
"april": "Apr",
"august": "Aug",
"december": "Dec",
"february": "Feb",
"january": "Jan",
"july": "Jul",
"june": "Jun",
"march": "Mar",
"may": "Maj",
"november": "Nov",
"october": "Okt",
"september": "Sep"
}

You may also try using sortingMethod to set custom sorting for your months. More info on using custom sort you can find by the following link: https://www.flexmonster.com/doc/custom-sorting/
 
Please let us know if it works for you. Feel free to contact us if other questions arise.
 
Kind regards,
Nadia

Please login or Register to Submit Answer