GenoPro Home
GenoPro Home  |  SDK Home  |  Report Generator  |  Support  |  Search  |  Help  |  Site Map

Skip Navigation Links.

GenoDate Class

The GenoDate class encapsulates a date. This object is present where a date involved in GenoPro such as the birth date, death date, wedding date, etc. The GenoDate object has properties only, and consequently, you cannot modify it.

Property Description
Anniversary Returns a new GenoDate object without the year. If the date was empty or the year was missing, the returned   GenoDate object is identical to its source. The Anniversary property may be useful to create a calendar of birthdays or remembering special events.
Century This is very similar to the Decade property. This property was added to offer the option to group events and/or objects by century.
Day Returns the day of the date or an empty string if the day is not present. Valid values ranges from "",   "1" to "31".
Decade Returns the decade year of the date or an empty string if the year is not present.  If the year is valid, last digit is always a zero. This property may be useful to group events and/or objects by decade. For instance, you may want to generate a picture album for the 60's, 70's, 80's, 90's, etc.
FormatDateSpan(Date) Returns the duration between the date and another specified date.
Month Returns the month of the date or an empty string if the month is not present. Valid values ranges from "",   "1" to "12".
NDay Returns the day of the date as a number. 0 if the day is not present.
NDayOfWeek Returns the day of the week (1=Monday, 7=Sunday). Returns zero if the weekday cannot be computed because the date is empty or incomplete.
NMonth Returns the month of the date as number. 0 if the month is not present. 
NYear Returns the year of the date as number. 0 if the year is not present. 
SystemDate Returns a date compatible with the operating system
ToString(String) Convert the date into a string based on a template.
ToStringNarrative Convert the date into a string based on the local system date time is defined (Control Panel).
Year Returns the year of the date or an empty string if the year is not present. Valid values ranges from "",   "0000" to "9999". The year is expressed in four digits, so year AD 476 would be expressed as "0476"

Usage:
The GenoDate object is user-friendly as it returns a string rather than a number. By having an empty string when a value is not present, it is possible to use "sandwich" methods such as Write3, Write3Br, WriteText3, WriteT3, and so on. A "sandwich method", such as Write3, does write the first and last parameter only if the middle parameter is non-empty. The following example writes to the output report "Year of Birth: " followed by the year of birth in bold. If the year of birth is empty, then this routine does not write anything to the output stream.

Report.Write3 "Year of Birth: <b>", i.birth.date.year, "</b><br />"

You could also use Write3Br to produce the same result:

Report.Write3Br "Year of Birth: <b>", i.birth.date.year, "</b>"

Translation:
You may translate the Date enumeration in the language dictionary.

See Also:
Report.Write3
Report.Write3Br
Report.WriteText3
Report.WriteText3Br
Report.WriteT3
Report.WriteT3Br
 

 

Copyright © 1998-2024. All rights reserved. GenoPro® and the GenoPro logo are registered trademarks.