Revision 1292
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/xml_func.py | ||
---|---|---|
183 | 183 |
try: str_ = dict(items)['date'] |
184 | 184 |
except KeyError: |
185 | 185 |
items = dict(filter(lambda (k, v): v != 0, conv_items(int, items))) |
186 |
items.setdefault('year', dates.epoch.year) |
|
186 |
try: items['year'] # year is required |
|
187 |
except KeyError, e: raise SyntaxException(e) |
|
187 | 188 |
items.setdefault('month', 1) |
188 | 189 |
items.setdefault('day', 1) |
189 | 190 |
try: date = datetime.date(**items) |
Also available in: Unified diff
xml_func.py: _date: For year/month/day dates, require the year (it would not make sense to default to a particular year)