Korin API

DateGrammar5
in package

Read onlyYes
FinalYes

The GEDCOM 5.x date elements DATE_VALUE, DATE_PERIOD and DATE_EXACT (5.5.1 pages 45-48, 65): calendar escapes such as "@#DJULIAN@", "B.C." after any year (5.5: "A (B.C.) appended to the <YEAR>"; 5.5.1 writes it only after a lone year, but "MAR 44 B.C." means the same in both), dual years ("1699/00") in the Gregorian calendar, date phrases in parentheses. Keywords and months are case-insensitive. @#DROMAN@ and @#DUNKNOWN@ are "for future definition": any day, word and year is accepted.

5.5.5 (DATE_GREG, DATE_JULN, YEAR, DAY, DUAL_STYLE_YEAR) is stricter and slightly different: years of 3 or 4 digits, days without a leading zero, "BCE", "BC" or "B.C." after a space and only after a lone Gregorian or Julian year, dual years in both of these calendars but only with a month, a Gregorian day and month without a year ("23 AUG"), and no @#DROMAN@.

Table of Contents

Constants

BAD_DUAL_YEAR  : mixed = 2
A dual year whose second part is not the following year: "1701/99".
DAY_OUT_OF_RANGE  : mixed = 1
A day beyond the length of its month.
INVALID  : mixed = 3
Not a date of the grammar; outranks the others.
VALID  : mixed = 0

Methods

__construct()  : mixed
check()  : self::VALID|self::DAY_OUT_OF_RANGE|self::BAD_DUAL_YEAR|self::INVALID

Constants

BAD_DUAL_YEAR

A dual year whose second part is not the following year: "1701/99".

public mixed BAD_DUAL_YEAR = 2

DAY_OUT_OF_RANGE

A day beyond the length of its month.

public mixed DAY_OUT_OF_RANGE = 1

INVALID

Not a date of the grammar; outranks the others.

public mixed INVALID = 3

Methods

__construct()

public __construct(callable(string): array<int, string> $enumeration[, bool $v555 = false ]) : mixed
Parameters
$enumeration : callable(string): array<int, string>

values of an element, from the profile

$v555 : bool = false

whether the 5.5.5 date grammar applies

check()

public check(string $grammar, string $value) : self::VALID|self::DAY_OUT_OF_RANGE|self::BAD_DUAL_YEAR|self::INVALID
Parameters
$grammar : string
$value : string
Return values
self::VALID|self::DAY_OUT_OF_RANGE|self::BAD_DUAL_YEAR|self::INVALID
On this page

Search results