Class FormalDate
Class representing a fully parsed GedcomX standard date, for the purpose of creating or understanding GedcomX formal date strings. Format of a GedcomX formal dates are made up by strings of these types:
Simple date: (+|-)YYYY[-MM[-DD[Thh[:mm[:ss[(+-)hh[:mm]|Z]]]]]]
Duration: P[yyyyY][mmM][ddD][T[hhH][mmM][ssS]]
Closed date Range: [simpleDate]/[simpleDate|Duration] Open-ended date range: [simpleDate]/ /[simpleDate] Recurring date R[repetitions]/simpleDate/(simpleDate|Duration) Approximate date or date range A(simpleDate) A(dateRange)
=> (A | R[repetitions]/simpleDate/(simpleDate|Duration)) => [A]simpleDate [A]simpleDate/[simpleDate|Duration] [A]/simpleDate R[repetitions]/simpleDate/(simpleDate|Duration)
User: danny yeshurun (ported from Java) Date: 6/23/14 Time: 11:48 PM
Methods summary
public
|
|
public
boolean
|
|
public
string
|
|
public
|
|
public
|
#
getDuration( )
Get the Duration portion of a FormalDate, or null if there is no duration. If the duration is non-null, then the starting date must be non-null. A duration is used in a range or in a recurring date. Must be null if the end is non-null. |
public
|
#
setEnd(
Set the ending date of this FormalDate range. If the starting date is null, then the date is interpreted as "any time up to this ending time". If the date is a range, and the end is null, then it means "any time from the starting date or later". If the date is not a range, the end must be null. If the date is a range, then either the start or end must be non-null. |
public
|
#
getEnd( )
Get the ending date for this FormalDate range. If the starting date is null, then the FormalDate is interpreted as "any time up to this ending date". If the date is a range, and the end is null, then it means "any time from the starting date or later." If the date is not a range, the end must be null. |
public
|
#
setIsApproximate( mixed $isApproximate )
Set the flag for whether this date is approximate. Note that it is illegal to have an approximate repeating date. |
public
mixed
|
|
public
|
|
public
mixed
|
|
public
|
#
setIsRecurring( mixed $isRecurring )
Set the flag for whether this is a recurring date, in which case there must be a start date and either an end date or a duration (but not both). |
public
mixed
|
#
getIsRecurring( )
Get the flag for whether this date is a repeating date. If so, then there must be a start date, and either an end date or a duration (but not both). |
public
|
#
setNumRepetitions( mixed $numRepetitions )
Set the number of repetitions for a recurring date. Ignored if the date is not recurring. If null, a recurring date is assumed to have no limit on the number of repetitions. |
public
mixed
|
|
public
|
#
setStart(
Set the starting date. (If the date is not a range, this is the whole date). |
public
|