Class VietnameseCalendar

All Implemented Interfaces:
Serializable, Comparable<VietnameseCalendar>, CalendarDate, ChronoDisplay, Temporal<CalendarDate>, LocalizedPatternSupport

@CalendarType("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.

Introduction

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.

  • 1813–1840: It was essentially the Shíxiàn calendar introduced by the Chinese Qing dynasty to the Vietnamese Nguyễn dynasty.
  • 1841-1954: Hiệp-kỷ-calendar began to differ from Shíxiàn due to longitudinal differences between Vietnam and China.
  • 1955-1967: UTC+8 is used for calendar calculations.
  • since 1968: UTC+7 is used (first in North Vietnam, since reunification in 1975 also in Southern part).

Following elements which are declared as constants are registered by this class

Furthermore, all elements defined in EpochDays and CommonElements are supported.

Example of usage

     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));
 

Support for unicode ca-extensions

      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)"));
 
Since:
3.40/4.35
Author:
Meno Hochschild
See Also:
ChineseCalendar, Serialized Form