Class FormatHelper
- java.lang.Object
-
- org.apache.openmeetings.db.util.FormatHelper
-
public class FormatHelper extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringformatUser(User u)static StringformatUser(User u, boolean isHTMLEscape)static org.apache.commons.lang3.time.FastDateFormatgetDateFormat(User u)static org.apache.commons.lang3.time.FastDateFormatgetDateTimeFormat(User u)static org.apache.commons.lang3.time.FastDateFormatgetTimeFormat(User u)static booleanisRtlLanguage(String languageString)Check if a BCP 47 / III language code indicates an RTL language, i.e.
-
-
-
Method Detail
-
isRtlLanguage
public static boolean isRtlLanguage(String languageString)
Check if a BCP 47 / III language code indicates an RTL language, i.e. either: - a language code explicitly specifying one of the right-to-left scripts, e.g. "az-Arab", or- a language code specifying one of the languages normally written in a right-to-left script, e.g. "fa" (Farsi), except ones explicitly specifying Latin or Cyrillic script (which are the usual LTR alternatives).
The list of right-to-left scripts appears in the 100-199 range in http://www.unicode.org/iso15924/iso15924-num.html, of which Arabic and Hebrew are by far the most widely used. We also recognize Thaana, N'Ko, and Tifinagh, which also have significant modern usage. The rest (Syriac, Samaritan, Mandaic, etc.) seem to have extremely limited or no modern usage and are not recognized. The languages usually written in a right-to-left script are taken as those with Suppress-Script: Hebr|Arab|Thaa|Nkoo|Tfng in http://www.iana.org/assignments/language-subtag-registry, as well as Sindhi (sd) and Uyghur (ug). The presence of other subtags of the language code, e.g. regions like EG (Egypt), is ignored.
- Parameters:
languageString- - locale string- Returns:
truein case passed locale is right-to-left
-
getDateFormat
public static org.apache.commons.lang3.time.FastDateFormat getDateFormat(User u)
-
getTimeFormat
public static org.apache.commons.lang3.time.FastDateFormat getTimeFormat(User u)
-
getDateTimeFormat
public static org.apache.commons.lang3.time.FastDateFormat getDateTimeFormat(User u)
-
-