[gnumeric] Docs: defined macro for calendar basis help.



commit 1ede7836a93abb00cef270ac0cd6c470275cd7d7
Author: Morten Welinder <terra gnome org>
Date:   Wed Jul 29 21:17:56 2009 -0400

    Docs: defined macro for calendar basis help.

 plugins/fn-date/functions.c |   20 ++++++++------------
 src/gnm-datetime.h          |    8 ++++++++
 2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/plugins/fn-date/functions.c b/plugins/fn-date/functions.c
index 9b7b768..f05e116 100644
--- a/plugins/fn-date/functions.c
+++ b/plugins/fn-date/functions.c
@@ -1131,18 +1131,14 @@ gnumeric_weeknum (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
 /***************************************************************************/
 
 static GnmFuncHelp const help_yearfrac[] = {
-	{ GNM_FUNC_HELP_OLD,
-	F_("@FUNCTION=YEARFRAC\n"
-	   "@SYNTAX=YEARFRAC (start_date, end_date [,basis])\n"
-
-	   "@DESCRIPTION="
-	   "YEARFRAC returns the number of full days between @start_date and "
-	   "@end_date according to the @basis.\n"
-	   "\n"
-	   "@EXAMPLES=\n"
-	   "\n"
-	   "@SEEALSO=DATEDIF")
-	},
+        { GNM_FUNC_HELP_NAME, F_("YEARFRAC:calculates fractional number of years between dates")},
+        { GNM_FUNC_HELP_ARG, F_("start_date:starting date serial value")},
+        { GNM_FUNC_HELP_ARG, F_("end_date:ending date serial value")},
+        { GNM_FUNC_HELP_ARG, F_("basis:calendar basis")},
+	{ GNM_FUNC_HELP_DESCRIPTION, F_("YEARFRAC calculates the number of days from @{start_date} to @{end_date} according to the calendar specified by @{basis}, which defaults to 0, and expresses the result as a fractional number of years.") },
+	GNM_DATE_BASIS_HELP
+        { GNM_FUNC_HELP_SEEALSO, "DATE"},
+        { GNM_FUNC_HELP_EXAMPLES, "=YEARFRAC(DATE(2000,1,1),DATE(2001,4,1))" },
 	{ GNM_FUNC_HELP_END }
 };
 
diff --git a/src/gnm-datetime.h b/src/gnm-datetime.h
index 6d8de9e..5e54c04 100644
--- a/src/gnm-datetime.h
+++ b/src/gnm-datetime.h
@@ -25,6 +25,14 @@ void gnm_date_add_days (GDate *d, int n);
 void gnm_date_add_months (GDate *d, int n);
 void gnm_date_add_years (GDate *d, int n);
 
+#define GNM_DATE_BASIS_HELP							\
+	{ GNM_FUNC_HELP_NOTE, F_("If @{basis} is 0, then the US 30/360 method is used.") }, \
+	{ GNM_FUNC_HELP_NOTE, F_("If @{basis} is 1, then actual number of days is used.") }, \
+	{ GNM_FUNC_HELP_NOTE, F_("If @{basis} is 2, then actual number of days is used within a month, but years are considered only 360 days.") }, \
+	{ GNM_FUNC_HELP_NOTE, F_("If @{basis} is 3, then actual number of days is used within a month, but years are always considered 365 days.") }, \
+	{ GNM_FUNC_HELP_NOTE, F_("If @{basis} is 4, then the European 30/360 method is used.") },
+
+
 G_END_DECLS
 
 #endif /* _GNM_DATETIME_H_ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]