gedcomx-php-client
  • Namespace
  • Class

Namespaces

  • Gedcomx
    • Agent
    • Atom
    • Common
    • Conclusion
    • Extensions
      • FamilySearch
        • Platform
          • Artifacts
          • Discussions
          • Tree
          • Users
        • Rs
          • Client
            • FamilyTree
            • Helpers
            • Memories
            • Util
        • Rt
        • Types
    • GedcomxFile
    • Links
    • Records
    • Rs
      • Client
        • Exception
        • Options
        • Util
    • Rt
    • Search
    • Source
    • Support
    • Types
    • Util
    • Vocab

Classes

  • Collection
  • Duration
  • FormalDate
  • JsonMapper
  • SimpleDate
  • XmlMapper

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

Namespace: Gedcomx\Util
Located at Util/FormalDate.php

Methods summary

public
# parse( $formalDateString )

Parses a formal date string.

Parses a formal date string.

Parameters

$formalDateString

Throws

Exception
public boolean
# isValid( )

Tell whether the current state of the date is valid for a GedcomX formal date. In particular, make sure it follows one of the following patterns: [A]simpleDate [A]simpleDate/[simpleDate|Duration] [A]/simpleDate R[repetitions]/simpleDate/(simpleDate|Duration)

Tell whether the current state of the date is valid for a GedcomX formal date. In particular, make sure it follows one of the following patterns: [A]simpleDate [A]simpleDate/[simpleDate|Duration] [A]/simpleDate R[repetitions]/simpleDate/(simpleDate|Duration)

Returns

boolean
public string
# __toString( )

Convert a FormalDate to a string

Convert a FormalDate to a string

Returns

string
public
# setDuration( Gedcomx\Util\Duration $duration )

Set the duration of a FormalDate.

Set the duration of a FormalDate.

Parameters

$duration
public Gedcomx\Util\Duration
# 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.

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.

Returns

Gedcomx\Util\Duration
public
# setEnd( Gedcomx\Util\SimpleDate $end )

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.

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.

Parameters

$end
public Gedcomx\Util\SimpleDate
# 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.

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.

Returns

Gedcomx\Util\SimpleDate
public
# setIsApproximate( mixed $isApproximate )

Set the flag for whether this date is approximate. Note that it is illegal to have an approximate repeating date.

Set the flag for whether this date is approximate. Note that it is illegal to have an approximate repeating date.

Parameters

$isApproximate
public mixed
# getIsApproximate( )

Tell whether this FormalDate is approximate.

Tell whether this FormalDate is approximate.

Returns

mixed
public
# setIsRange( mixed $isRange )

Set the flag for whether this FormalDate is a range.

Set the flag for whether this FormalDate is a range.

Parameters

$isRange
public mixed
# getIsRange( )

Tell whether this date is a range.

Tell whether this date is a range.

Returns

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

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

Parameters

$isRecurring
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).

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

Returns

mixed
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.

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.

Parameters

$numRepetitions
public mixed
# getNumRepetitions( )

Get the number of repetitions for a recurring date, or null if none.

Get the number of repetitions for a recurring date, or null if none.

Returns

mixed
public
# setStart( Gedcomx\Util\SimpleDate $start )

Set the starting date. (If the date is not a range, this is the whole date).

Set the starting date. (If the date is not a range, this is the whole date).

Parameters

$start
public Gedcomx\Util\SimpleDate
# getStart( )

Get the starting date for this FormalDate. If the date is not a range, this is the whole date. If the date is a range, and this is null, then it implies "any time before the ending date". Must not be null if this FormalDate is not a range.

Get the starting date for this FormalDate. If the date is not a range, this is the whole date. If the date is a range, and this is null, then it implies "any time before the ending date". Must not be null if this FormalDate is not a range.

Returns

Gedcomx\Util\SimpleDate
gedcomx-php-client API documentation generated by ApiGen