/*
 * $Id: dayofyr.txt 15102 2010-07-14 12:48:39Z vszakats $
 */

/*  $DOC$
 *  $FUNCNAME$
 *     FT_DAYOFYR()
 *  $CATEGORY$
 *     Date/Time
 *  $ONELINER$
 *     Return calendar, fiscal or accounting day data
 *  $SYNTAX$
 *     FT_DAYOFYR( [ <dGivenDate> ], [ <nDayNum> ], [ <lIsAcct> ] )
 *            -> aDateInfo
 *  $ARGUMENTS$
 *     <dGivenDate> is any valid date in any valid format.  Defaults
 *     to current system date if not supplied.
 * 
 *     <nDayNum> is a number from 1 to 371, signifying a day of a year.
 *     Defaults to current day if not supplied.
 * 
 *     <lIsAcct> is a logical which specifies the type of year to base
 *     the return value on:  .F. = calendar or fiscal year,
 *     .T. = accounting year.
 *  $RETURNS$
 *     A three element array containing the following data:
 * 
 *        If <nDayNum> is specified:
 * 
 *        aDateInfo[1] - The date of the specified day number
 *        aDateInfo[2] - The beginning date of the year
 *        aDateInfo[3] - The ending date of the year
 * 
 *        If <nDayNum> is not specified:
 * 
 *        aDateInfo[1] - The year and day as a character string "YYYYDDD"
 *        aDateInfo[2] - The beginning date of the year
 *        aDateInfo[3] - The ending date of the year
 *  $DESCRIPTION$
 *     FT_DAYOFYR() returns an array containing data about a day in the
 *     calendar or fiscal year containing the given date.
 * 
 *     The beginning of year date defaults to January 1st but may be
 *     changed with FT_DATECNFG().
 *  $EXAMPLES$
 *     aDateInfo := FT_DAYOFYR( CTOD("03/31/91") )
 *     ? aDateInfo[1]        // 1991090    (90th day of year 1991)
 *     ? aDateInfo[2]        // 01/01/91
 *     ? aDateInfo[3]        // 12/31/91
 * 
 *     aDateInfo := FT_DAYOFYR( , 90 )    // assume current date is 3/31/91
 *     ? aDateInfo[1]        // 03/31/91    (90th day of year)
 *     ? aDateInfo[2]        // 01/01/91
 *     ? aDateInfo[3]        // 12/31/91
 * 
 *     aDateInfo := FT_DAYOFYR( , 90, .T. )
 *     ? aDateInfo[1]        // 03/29/91    (90th day of accounting year)
 *     ? aDateInfo[2]        // 12/30/90    (1st day of accounting year)
 *     ? aDateInfo[3]        // 12/28/91    (last day of accounting year)
 *  $SEEALSO$
 *     FT_DATECNFG()
 *  $END$
 */
