/** * Returns the available chronologies. * <p> * Each returned {@code Chronology} is available for use in the system. * The set of chronologies includes the system chronologies and * any chronologies provided by the application via ServiceLoader * configuration. * * @return Chronology[] the independent, modifiable set of the available chronology IDs, not null */ static function getAvailableChronologies() { return [IsoChronology::INSTANCE(), MinguoChronology::INSTANCE(), ThaiBuddhistChronology::INSTANCE()]; }
/** * Gets the chronology of this date, which is the Minguo calendar system. * <p> * The {@code Chronology} represents the calendar system in use. * The era and other fields in {@link ChronoField} are defined by the chronology. * * @return MinguoChronology the Minguo chronology, not null */ public function getChronology() { return MinguoChronology::INSTANCE(); }
public function provider_reducedWithChrono() { $baseYear = LocalDate::of(2000, 1, 1); return [[IsoChronology::INSTANCE()->dateFrom($baseYear)], [IsoChronology::INSTANCE()->dateFrom($baseYear)->plus(1, ChronoUnit::YEARS())], [IsoChronology::INSTANCE()->dateFrom($baseYear)->plus(99, ChronoUnit::YEARS())], [MinguoChronology::INSTANCE()->dateFrom($baseYear)], [MinguoChronology::INSTANCE()->dateFrom($baseYear)->plus(1, ChronoUnit::YEARS())], [MinguoChronology::INSTANCE()->dateFrom($baseYear)->plus(99, ChronoUnit::YEARS())], [ThaiBuddhistChronology::INSTANCE()->dateFrom($baseYear)], [ThaiBuddhistChronology::INSTANCE()->dateFrom($baseYear)->plus(1, ChronoUnit::YEARS())], [ThaiBuddhistChronology::INSTANCE()->dateFrom($baseYear)->plus(99, ChronoUnit::YEARS())]]; }
/** * @expectedException \Celest\DateTimeParseException */ public function test_fieldResolvesToChronoZonedDateTime_overrideChrono_wrongChrono() { $cldt = ThaiBuddhistChronology::INSTANCE()->dateNow()->atTime(LocalTime::NOON())->atZone(self::EUROPE_PARIS()); $f = (new DateTimeFormatterBuilder())->appendValue(new ResolvingField($cldt))->toFormatter(); $f = $f->withChronology(MinguoChronology::INSTANCE()); $f->parse("1234567890"); }
function localizedDateTimePatterns() { return [[FormatStyle::FULL(), FormatStyle::FULL(), IsoChronology::INSTANCE(), Locale::US(), "EEEE, MMMM d, y 'at' h:mm:ss a zzzz"], [FormatStyle::LONG(), FormatStyle::LONG(), IsoChronology::INSTANCE(), Locale::US(), "MMMM d, y 'at' h:mm:ss a z"], [FormatStyle::MEDIUM(), FormatStyle::MEDIUM(), IsoChronology::INSTANCE(), Locale::US(), "MMM d, y, h:mm:ss a"], [FormatStyle::SHORT(), FormatStyle::SHORT(), IsoChronology::INSTANCE(), Locale::US(), "M/d/yy, h:mm a"], [FormatStyle::FULL(), null, IsoChronology::INSTANCE(), Locale::US(), "EEEE, MMMM d, y"], [FormatStyle::LONG(), null, IsoChronology::INSTANCE(), Locale::US(), "MMMM d, y"], [FormatStyle::MEDIUM(), null, IsoChronology::INSTANCE(), Locale::US(), "MMM d, y"], [FormatStyle::SHORT(), null, IsoChronology::INSTANCE(), Locale::US(), "M/d/yy"], [null, FormatStyle::FULL(), IsoChronology::INSTANCE(), Locale::US(), "h:mm:ss a zzzz"], [null, FormatStyle::LONG(), IsoChronology::INSTANCE(), Locale::US(), "h:mm:ss a z"], [null, FormatStyle::MEDIUM(), IsoChronology::INSTANCE(), Locale::US(), "h:mm:ss a"], [null, FormatStyle::SHORT(), IsoChronology::INSTANCE(), Locale::US(), "h:mm a"], [FormatStyle::FULL(), FormatStyle::FULL(), IsoChronology::INSTANCE(), Locale::FRENCH(), "EEEE d MMMM y 'à' HH:mm:ss zzzz"], [FormatStyle::LONG(), FormatStyle::LONG(), IsoChronology::INSTANCE(), Locale::FRENCH(), "d MMMM y 'à' HH:mm:ss z"], [FormatStyle::MEDIUM(), FormatStyle::MEDIUM(), IsoChronology::INSTANCE(), Locale::FRENCH(), "d MMM y 'à' HH:mm:ss"], [FormatStyle::SHORT(), FormatStyle::SHORT(), IsoChronology::INSTANCE(), Locale::FRENCH(), "dd/MM/y HH:mm"], [FormatStyle::FULL(), null, IsoChronology::INSTANCE(), Locale::FRENCH(), "EEEE d MMMM y"], [FormatStyle::LONG(), null, IsoChronology::INSTANCE(), Locale::FRENCH(), "d MMMM y"], [FormatStyle::MEDIUM(), null, IsoChronology::INSTANCE(), Locale::FRENCH(), "d MMM y"], [FormatStyle::SHORT(), null, IsoChronology::INSTANCE(), Locale::FRENCH(), "dd/MM/y"], [null, FormatStyle::FULL(), IsoChronology::INSTANCE(), Locale::FRENCH(), "HH:mm:ss zzzz"], [null, FormatStyle::LONG(), IsoChronology::INSTANCE(), Locale::FRENCH(), "HH:mm:ss z"], [null, FormatStyle::MEDIUM(), IsoChronology::INSTANCE(), Locale::FRENCH(), "HH:mm:ss"], [null, FormatStyle::SHORT(), IsoChronology::INSTANCE(), Locale::FRENCH(), "HH:mm"], [FormatStyle::FULL(), FormatStyle::FULL(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy\\u5e74M\\u6708d\\u65e5EEEE ahh'\\u65f6'mm'\\u5206'ss'\\u79d2' z"], [FormatStyle::LONG(), FormatStyle::LONG(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy\\u5e74M\\u6708d\\u65e5 ahh'\\u65f6'mm'\\u5206'ss'\\u79d2'"], [FormatStyle::MEDIUM(), FormatStyle::MEDIUM(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy-M-d H:mm:ss"], [FormatStyle::SHORT(), FormatStyle::SHORT(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy-M-d ah:mm"], [FormatStyle::FULL(), null, MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy\\u5e74M\\u6708d\\u65e5EEEE"], [FormatStyle::LONG(), null, MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy\\u5e74M\\u6708d\\u65e5"], [FormatStyle::MEDIUM(), null, MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy-M-d"], [FormatStyle::SHORT(), null, MinguoChronology::INSTANCE(), Locale::CHINESE(), "Gy-M-d"], [null, FormatStyle::FULL(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "ahh'\\u65f6'mm'\\u5206'ss'\\u79d2' z"], [null, FormatStyle::LONG(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "ahh'\\u65f6'mm'\\u5206'ss'\\u79d2'"], [null, FormatStyle::MEDIUM(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "H:mm:ss"], [null, FormatStyle::SHORT(), MinguoChronology::INSTANCE(), Locale::CHINESE(), "ah:mm"]]; }