@CalendarType(value="vietnam") public final class VietnameseCalendar extends EastAsianCalendar<VietnameseCalendar.Unit,VietnameseCalendar> implements LocalizedPatternSupport
Represents the Vietnamese calendar supported in the gregorian range 1813-02-01/3000-01-27.
It is a lunisolar calendar which is supposed to be structurally identical to the Chinese calendar. See also the page of Ho Ngoc Duc. The historic details of the calendar rules before 1954 are somehow debatable. Probably different authorities or institutions in Vietnam used slightly different versions of Chinese calendar. Time4J follows the rules described on Wikipedia.
DAY_OF_WEEKDAY_OF_MONTHDAY_OF_YEARWEEKDAY_IN_MONTHMONTH_OF_YEARMONTH_AS_ORDINALSOLAR_TERMYEAR_OF_CYCLECYCLEFurthermore, all elements defined in EpochDays and CommonElements are supported.
ChronoFormatter<VietnameseCalendar> formatter =
ChronoFormatter.setUp(VietnameseCalendar.axis(), Locale.ENGLISH)
.addPattern("EEE, d. MMMM U(r)", PatternType.CLDR_DATE).build();
PlainDate today = SystemClock.inLocalView().today();
VietnameseCalendar vietDate = today.transform(VietnameseCalendar.class);
System.out.println(formatter.format(vietDate));
Locale locale = Locale.forLanguageTag("en-u-ca-vietnam");
ChronoFormatter<CalendarDate> f = ChronoFormatter.ofGenericCalendarStyle(DisplayMode.FULL, locale);
assertThat(
f.format(PlainDate.of(2017, 10, 1)),
is("Sunday, Eighth Month 12, 2017(dīng-yǒu)"));
ChineseCalendar,
Serialized Form| Modifier and Type | Class and Description |
|---|---|
static class |
VietnameseCalendar.Unit
Defines some calendar units for the Vietnamese calendar.
|
| Modifier and Type | Field and Description |
|---|---|
static ChronoElement<Integer> |
CYCLE
Represents the cycle number related to the introduction of sexagesimal cycles
by the legendary Chinese yellow emperor Huang-Di on -2636-02-15 (gregorian).
|
static StdCalendarElement<Integer,VietnameseCalendar> |
DAY_OF_MONTH
Represents the Vietnamese day of month.
|
static StdCalendarElement<Weekday,VietnameseCalendar> |
DAY_OF_WEEK
Represents the Vietnamese day of week.
|
static StdCalendarElement<Integer,VietnameseCalendar> |
DAY_OF_YEAR
Represents the Vietnamese day of year.
|
static StdCalendarElement<Integer,VietnameseCalendar> |
MONTH_AS_ORDINAL
Represents the ordinal index of a Vietnamese month in the range
1-12/13. |
static TextElement<EastAsianMonth> |
MONTH_OF_YEAR
Represents the Vietnamese month.
|
static ChronoElement<SolarTerm> |
SOLAR_TERM
Represents the solar term as one of 24 possible stations of the sun on the ecliptic.
|
static OrdinalWeekdayElement<VietnameseCalendar> |
WEEKDAY_IN_MONTH
Element with the ordinal day-of-week within given calendar month.
|
static TextElement<CyclicYear> |
YEAR_OF_CYCLE
Represents the Vietnamese year related to the current sexagesimal cycle.
|
| Modifier and Type | Method and Description |
|---|---|
static TimeAxis<VietnameseCalendar.Unit,VietnameseCalendar> |
axis()
Returns the associated time axis.
|
static Weekmodel |
getDefaultWeekmodel()
Obtains the standard week model of this calendar.
|
static boolean |
isValid(EastAsianYear year,
EastAsianMonth month,
int dayOfMonth)
Queries if given parameter values form a well defined calendar date.
|
static VietnameseCalendar |
nowInSystemTime()
Obtains the current calendar date in system time.
|
static VietnameseCalendar |
of(EastAsianYear year,
EastAsianMonth month,
int dayOfMonth)
Creates a new instance of a Vietnamese calendar date.
|
static VietnameseCalendar |
ofTet(int gregorianYear)
Creates a new instance of a Vietnamese calendar date on New Year (Tet).
|
at, atTime, equals, findLeapMonth, getDayOfMonth, getDayOfWeek, getDayOfYear, getDaysSinceEpochUTC, getMonth, getSexagesimalDay, getSexagesimalMonth, getSolarTerm, getYear, hashCode, isLeapYear, lengthOfMonth, lengthOfYear, toString, withBeginOfNextLeapMonthcompareTo, isAfter, isBefore, isSimultaneous, minus, plusmax, min, minus, minus, plus, plus, until, untilcontains, get, get, getInt, getMaximum, getMinimum, getRegisteredElements, getTimezone, hasTimezone, isValid, isValid, isValid, matches, with, with, with, withgetFormatPattern, getFormatPattern, useDynamicFormatPatternfrom, from, from, transform, transform, transform, transform, transform, transformisAfterAll, isAfterOrEqual, isBeforeAll, isBeforeOrEqualpublic static final ChronoElement<Integer> CYCLE
Represents the cycle number related to the introduction of sexagesimal cycles by the legendary Chinese yellow emperor Huang-Di on -2636-02-15 (gregorian).
This kind of counting is NOT in common use in Vietnam and only offered for technical reasons. Prefer just the cyclic year together with the related gregorian year instead.
@FormattableElement(format="U") public static final TextElement<CyclicYear> YEAR_OF_CYCLE
Represents the Vietnamese year related to the current sexagesimal cycle.
public static final ChronoElement<SolarTerm> SOLAR_TERM
Represents the solar term as one of 24 possible stations of the sun on the ecliptic.
ChineseCalendar.SOLAR_TERM@FormattableElement(format="M", alt="L") public static final TextElement<EastAsianMonth> MONTH_OF_YEAR
Represents the Vietnamese month.
public static final StdCalendarElement<Integer,VietnameseCalendar> MONTH_AS_ORDINAL
Represents the ordinal index of a Vietnamese month in the range 1-12/13.
This element can be used in conjunction with
ordinal formatting.
@FormattableElement(format="d") public static final StdCalendarElement<Integer,VietnameseCalendar> DAY_OF_MONTH
Represents the Vietnamese day of month.
Months have either 29 or 30 days.
@FormattableElement(format="D") public static final StdCalendarElement<Integer,VietnameseCalendar> DAY_OF_YEAR
Represents the Vietnamese day of year.
@FormattableElement(format="E") public static final StdCalendarElement<Weekday,VietnameseCalendar> DAY_OF_WEEK
Represents the Vietnamese day of week.
If the day-of-week is set to a new value then Time4J handles the Chinese calendar week as starting on Monday (like in modern Vietnam).
@FormattableElement(format="F") public static final OrdinalWeekdayElement<VietnameseCalendar> WEEKDAY_IN_MONTH
Element with the ordinal day-of-week within given calendar month.
public static VietnameseCalendar ofTet(int gregorianYear)
Creates a new instance of a Vietnamese calendar date on New Year (Tet).
gregorianYear - gregorian calendar yearVietnameseCalendarIllegalArgumentException - in case of any inconsistenciespublic static VietnameseCalendar of(EastAsianYear year, EastAsianMonth month, int dayOfMonth)
Creates a new instance of a Vietnamese calendar date.
year - references the year using sexagesimal cyclesmonth - the month which might be a leap monthdayOfMonth - the day of month to be checkedChineseCalendarIllegalArgumentException - in case of any inconsistenciespublic static VietnameseCalendar nowInSystemTime()
Obtains the current calendar date in system time.
Convenient short-cut for: SystemClock.inLocalView().now(VietnameseCalendar.axis()).
SystemClock.inLocalView(),
ZonalClock.now(Chronology)public static boolean isValid(EastAsianYear year, EastAsianMonth month, int dayOfMonth)
Queries if given parameter values form a well defined calendar date.
year - the year to be checkedmonth - the month to be checkeddayOfMonth - the day of month to be checkedtrue if valid else falsepublic static Weekmodel getDefaultWeekmodel()
Obtains the standard week model of this calendar.
The modern Vietnamese calendar usually starts on Monday.
public static TimeAxis<VietnameseCalendar.Unit,VietnameseCalendar> axis()
Returns the associated time axis.
Copyright © 2014–2021. All rights reserved.