diff --git a/roundup/date.py b/roundup/date.py
index 7daf952d5a01364b2a4a3ad89e61de9a11885adf..f857bf7c969103488280ffa7777a8352a6248607 100644 (file)
--- a/roundup/date.py
+++ b/roundup/date.py
info = m.groupdict()
- # determine whether we need to add anything at the end
+ # If add_granularity is true, construct the maximum time given
+ # the precision of the input. For example, given the input
+ # "12:15", construct "12:15:59". Or, for "2008", construct
+ # "2008-12-31.23:59:59".
if add_granularity:
for gran in 'SMHdmy':
if info[gran] is not None:
else:
add_granularity = Interval('+1%s'%gran)
break
+ else:
+ raise ValueError(self._('Could not determine granularity'))
# get the current date as our default
dt = datetime.datetime.utcnow()