diff --git a/composer/schema/field.py b/composer/schema/field.py index 5bbc020..4619f95 100644 --- a/composer/schema/field.py +++ b/composer/schema/field.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2013 Helmut Merz helmutm@cy55.de +# Copyright (c) 2016 Helmut Merz helmutm@cy55.de # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -315,7 +315,10 @@ class DateFieldInstance(NumberFieldInstance): if langInfo: locale = locales.getLocale(langInfo.language) fmt = locale.dates.getFormatter(*format) - return fmt.format(value) + try: + return fmt.format(value) + except ValueError: + return str(value) return str(value) def unmarshall(self, value):