From 68e9b27265bb10083068a03fd73a30c20fa65da2 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 7 Jan 2010 21:41:07 +0000 Subject: [PATCH] Added method to make dates non-specific svn: r13990 --- src/gen/lib/date.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/gen/lib/date.py b/src/gen/lib/date.py index 94ba4b93f..827fdffc4 100644 --- a/src/gen/lib/date.py +++ b/src/gen/lib/date.py @@ -1690,6 +1690,19 @@ class Date(object): temp[Date._POS_RSL] = value self.dateval = tuple(temp) + def make_vague(self): + """ + Remove month and day details to make the date approximate. + """ + dv = list(self.dateval) + dv[Date._POS_MON] = 0 + dv[Date._POS_DAY] = 0 + if Date._POS_RDAY < len(dv): + dv[Date._POS_RDAY] = 0 + dv[Date._POS_RMON] = 0 + self.dateval = tuple(dv) + self._calc_sort_value() + def Today(): """ Returns a Date object set to the current date.