Month format - MMM (Apr) in Other Languages

0
Hello Experts, Currently I am using the dateTimeFormat($Date, MMM) → which will give “Apr”. Also I have a Arabic language where I need the same “Apr” in Arabic language. Is there any option for getting the dateTimeFormat in Specific language. If so, please let me know. Answers are really much appreciated!
asked
2 answers
4

Hi Arun ,

You need to use custom java action for this called as hijri date in arabic , for arabic you can’t directly translate the date its pattern its different from english

sample code for below for your reference 

import org.joda.time.Chronology;
import org.joda.time.LocalDate;
import org.joda.time.chrono.IslamicChronology;
import org.joda.time.chrono.ISOChronology;

public class Test {
    public static void main(String[] args) throws Exception {
        Chronology iso = ISOChronology.getInstanceUTC();
        Chronology hijri = IslamicChronology.getInstanceUTC();

        LocalDate todayIso = new LocalDate(2013, 3, 31, iso);
        LocalDate todayHijri = new LocalDate(todayIso.toDateTimeAtStartOfDay(),
                                             hijri);
        System.out.println(todayHijri); // 1434-05-19
    }
} 
answered
0

Maybe you can try to change the language setting of your application (tab languages). You can add an Arabic language here, then depending on the user language it may display it with the correct language.

If this is not working, you can probably make a IF with 12 condition, something like if “Apr” then “أبريل” etc...

answered