public class SimplePersianCalendar extends GregorianCalendar implements PersianCalendarConstants
java.util.GregorianCalendar,
with the added functionality that it can set/get date in the Persian
calendar system.
The algorithms for conversion between Persian and Gregorian calendar systems
are placed in PersianCalendarHelper class.| Modifier and Type | Field and Description |
|---|---|
static String[] |
persianMonths
Persian month names.
|
static String[] |
persianWeekDays
Persian week day names.
|
AD, BCALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET| Constructor and Description |
|---|
SimplePersianCalendar() |
| Modifier and Type | Method and Description |
|---|---|
DateFields |
getDateFields()
Retrieves the date of this calendar object as the
Persian date fields
|
long |
getJulianDay()
Get the Julian day corresponding to the date of this calendar.
|
String |
getPersianMonthName()
Gives the name of the current Persian month for this calendar's date.
|
static String |
getPersianMonthName(int month)
Gives the name of the specified Persian month.
|
String |
getPersianWeekDayName()
Gives the Persian name of the current day of the week for this
calendar's date.
|
static String |
getPersianWeekDayName(int weekDay)
Gives the Persian name of the specified day of week.
|
void |
setDateFields(DateFields dateFields)
Sets the date of this calendar object to the specified
Persian date fields
|
void |
setDateFields(int year,
int month,
int day)
Sets the date of this calendar object to the specified
Persian date (year, month, and day fields)
|
void |
setJulianDay(long julianDay)
Set the date of this calendar to the specified Julian day.
|
add, clone, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, hashCode, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setTimeZone, setWeekDateafter, before, clear, clear, compareTo, complete, get, getAvailableLocales, getDisplayName, getDisplayNames, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toStringpublic static final String[] persianMonths
public static final String[] persianWeekDays
public long getJulianDay()
public void setJulianDay(long julianDay)
julianDay - the desired Julian day to be set as the date of this calendar.public void setDateFields(int year,
int month,
int day)
year - the Persian year.month - the Persian month (zero-based).day - the Persian day of month.public void setDateFields(DateFields dateFields)
dateFields - the Persian date fields.public DateFields getDateFields()
public static String getPersianMonthName(int month)
month - the Persian month (zero-based).public String getPersianMonthName()
public static String getPersianWeekDayName(int weekDay)
weekDay - the day of week (use symbolic constants in the java.util.Calendar class).public String getPersianWeekDayName()
Copyright © 2015. All Rights Reserved.