Display partial dates as invalid
svn: r17760
This commit is contained in:
parent
916186039f
commit
a45d8fdd09
@ -980,7 +980,7 @@ class EditExifMetadata(Gramplet):
|
|||||||
|
|
||||||
entry = ValidatableMaskedEntry()
|
entry = ValidatableMaskedEntry()
|
||||||
entry.connect('validate', self.validate_datetime, widget)
|
entry.connect('validate', self.validate_datetime, widget)
|
||||||
# entry.connect('content-changed', self.set_datetime, widget)
|
entry.connect('content-changed', self.set_datetime, widget)
|
||||||
event_box.add(entry)
|
event_box.add(entry)
|
||||||
self.exif_widgets[widget] = entry
|
self.exif_widgets[widget] = entry
|
||||||
entry.show()
|
entry.show()
|
||||||
@ -1580,12 +1580,18 @@ def _parse_datetime(value):
|
|||||||
time_part = None
|
time_part = None
|
||||||
|
|
||||||
if date_part.get_modifier() == Date.MOD_NONE and time_part is not None:
|
if date_part.get_modifier() == Date.MOD_NONE and time_part is not None:
|
||||||
return datetime(date_part.get_year(),
|
if (date_part.get_year() == 0 or
|
||||||
date_part.get_month(),
|
date_part.get_month() == 0 or
|
||||||
date_part.get_day(),
|
date_part.get_day() == 0):
|
||||||
time_part.tm_hour,
|
# Partial date only
|
||||||
time_part.tm_min,
|
return None
|
||||||
time_part.tm_sec)
|
else:
|
||||||
|
return datetime(date_part.get_year(),
|
||||||
|
date_part.get_month(),
|
||||||
|
date_part.get_day(),
|
||||||
|
time_part.tm_hour,
|
||||||
|
time_part.tm_min,
|
||||||
|
time_part.tm_sec)
|
||||||
else:
|
else:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user