public class JalaliDateFormatter extends Object
JalaliDate
Note: for formatting gregorian date based on LocalDate you have to use DateTimeFormatter.
| Modifier and Type | Field and Description |
|---|---|
static int |
FORMAT_IN_ENGLISH
a flag for configuring the language of formatting.
|
static int |
FORMAT_IN_PERSIAN
a flag for configuring the language of formatting.
|
| Constructor and Description |
|---|
JalaliDateFormatter(String pattern)
constructor that sets english as a default formatting language.
|
JalaliDateFormatter(String pattern,
int formatLanguage)
constructor that sets desired language for formatting
|
| Modifier and Type | Method and Description |
|---|---|
String |
format(JalaliDate jalaliDate)
Returns a string that shows given jalali date in a proper formatting, it first parses the given pattern and
creates some place holders for future values then it applies format.
|
public static int FORMAT_IN_PERSIAN
you can call it from outside of the class for setting formatting language. usually can be used in constructor
public static int FORMAT_IN_ENGLISH
you can call it from outside of the class for setting formatting language. usually can be used in constructor
public JalaliDateFormatter(String pattern)
pattern - desired pattern.public JalaliDateFormatter(String pattern, int formatLanguage)
pattern - desired pattern.formatLanguage - shows the selected language which 1 is persian and 2 is english.public String format(JalaliDate jalaliDate)
jalaliDate - date that will be formatted in a proper way.Copyright © 2018. All rights reserved.