Trees | Indices | Help |
|
---|
|
The core date handling class for GRAMPs.
Supports partial dates, compound dates and alternate calendars.
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Class Variables | |
MOD_NONE = 0
|
|
MOD_BEFORE = 1
|
|
MOD_AFTER = 2
|
|
MOD_ABOUT = 3
|
|
MOD_RANGE = 4
|
|
MOD_SPAN = 5
|
|
MOD_TEXTONLY = 6
|
|
QUAL_NONE = 0
|
|
QUAL_ESTIMATED = 1
|
|
QUAL_CALCULATED = 2
|
|
CAL_GREGORIAN = 0
|
|
CAL_JULIAN = 1
|
|
CAL_HEBREW = 2
|
|
CAL_FRENCH = 3
|
|
CAL_PERSIAN = 4
|
|
CAL_ISLAMIC = 5
|
|
EMPTY =
|
|
calendar_names =
|
|
ui_calendar_names =
|
Method Details |
Compare two dates. Comparison function. Allows the usage of equality tests. This allows you do run statements like 'date1 <= date2' |
Return 1 if the given Date instance is the same as the present instance IN ALL REGARDS. Needed, because the __cmp__ only looks at the sorting value, and ignores the modifiers/comments. |
Return the minimal start_date, and a maximal stop_date corresponding to this date, given in Gregorian calendar. Useful in doing range overlap comparisons between different dates. Note that we stay in (YR,MON,DAY) |
Compare two dates using sophisticated techniques looking for any match between two possible dates, date spans and qualities. The other comparisons for Date (is_equal() and __cmp() don't actually look for anything other than a straight match, or a simple comparison of the sortval. comparison =,== : Returns True if any part of other_date matches any part of self comparison < : Returns True if any part of other_date < any part of self comparison << : Returns True if all parts of other_date < all parts of self comparison > : Returns True if any part of other_date > any part of self comparison >> : Returns True if all parts of other_date > all parts of self |
Produce a string representation of the Date object. If the date is not valid, the text representation is displayed. If the date is a range or a span, a string in the form of 'YYYY-MM-DD - YYYY-MM-DD' is returned. Otherwise, a string in the form of 'YYYY-MM-DD' is returned. |
Return the sort value of Date object. If the value is a text string, 0 is returned. Otherwise, the calculated sort date is returned. The sort date is rebuilt on every assignment. The sort value is an integer representing the value. The sortval is the integer number of days that have elapsed since Monday, January 1, 4713 BC in the proleptic Julian calendar. See http://en.wikipedia.org/wiki/Julian_day |
Return an integer indicating the calendar selected. The valid values are: MOD_NONE = no modifier (default) MOD_BEFORE = before MOD_AFTER = after MOD_ABOUT = about MOD_RANGE = date range MOD_SPAN = date span MOD_TEXTONLY = text only |
Return an integer indicating the calendar selected. The valid values are: QUAL_NONE = normal (default) QUAL_ESTIMATED = estimated QUAL_CALCULATED = calculated |
Return an integer indicating the calendar selected. The valid values are: CAL_GREGORIAN - Gregorian calendar CAL_JULIAN - Julian calendar CAL_HEBREW - Hebrew (Jewish) calendar CAL_FRENCH - French Republican calendar CAL_PERSIAN - Persian calendar CAL_ISLAMIC - Islamic calendar |
Return a tuple representing the start date. If the date is a compound date (range or a span), it is the first part of the compound date. If the date is a text string, a tuple of (0, 0, 0, False) is returned. Otherwise, a date of (DD, MM, YY, slash) is returned. If slash is True, then the date is in the form of 1530/1. |
Return a tuple representing the second half of a compound date. If the date is not a compound date, (including text strings) a tuple of (0, 0, 0, False) is returned. Otherwise, a date of (DD, MM, YY, slash) is returned. If slash is True, then the date is in the form of 1530/1. |
Return the year associated with the date. If the year is not defined, a zero is returned. If the date is a compound date, the lower date year is returned. |
Return the month associated with the date. If the month is not defined, a zero is returned. If the date is a compound date, the lower date month is returned. |
Return the day of the month associated with the date. If the day is not defined, a zero is returned. If the date is a compound date, the lower date day is returned. |
Return the day of the year associated with the second part of a compound date. If the year is not defined, a zero is returned. |
Return the month of the month associated with the second part of a compound date. If the month is not defined, a zero is returned. |
Return the day of the month associated with the second part of a compound date. If the day is not defined, a zero is returned. |
Return the high year estimate. For compound dates with non-zero stop year, the stop year is returned. Otherwise, the start year is returned. |
Set the date to the specified value. Parameters are: quality - The date quality for the date (see get_quality for more information) modified - The date modifier for the date (see get_modifier for more information) calendar - The calendar associated with the date (see get_calendar for more information). value - A tuple representing the date information. For a non-compound date, the format is (DD, MM, YY, slash) and for a compound date the tuple stores data as (DD, MM, YY, slash1, DD, MM, YY, slash2) text - A text string holding either the verbatim user input or a comment relating to the date. The sort value is recalculated. |
Return True if the date is a regular date. The regular date is a single exact date, i.e. not text-only, not a range or a span, not estimated/calculated, not about/before/after date, and having year, month, and day all non-zero. |
Return a new Date object in the calendar calendar_name. >>> Date("Jan 1 1591").to_calendar("julian") 1590-12-22 (Julian) |
Class Variable Details |
calendar_names
|
ui_calendar_names
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 9 21:52:30 2008 | http://epydoc.sourceforge.net |