fix #6: PT288H00M00S is a valid duration
This commit is contained in:
parent
a632925dc2
commit
684f7101b9
|
@ -41,9 +41,11 @@ def ods_date_value(value):
|
|||
|
||||
def time_value(value):
|
||||
"""convert to time value accroding the specification"""
|
||||
hour = int(value[2:4])
|
||||
minute = int(value[5:7])
|
||||
second = int(value[8:10])
|
||||
import re
|
||||
results = re.match('PT(\d+)H(\d+)M(\d+)S', value)
|
||||
hour = int(results.group(1))
|
||||
minute = int(results.group(2))
|
||||
second = int(results.group(3))
|
||||
if hour < 24:
|
||||
ret = datetime.time(hour, minute, second)
|
||||
else:
|
||||
|
|
|
@ -84,3 +84,10 @@ def test_issue_14():
|
|||
data = get_data(os.path.join("tests", "fixtures", test_file),
|
||||
skip_empty_rows=True)
|
||||
eq_(data['S-LMC'], [[u'aaa'], [0]])
|
||||
|
||||
|
||||
def test_issue_6():
|
||||
test_file = "12_day_as_time.ods"
|
||||
data = get_data(os.path.join("tests", "fixtures", test_file),
|
||||
skip_empty_rows=True)
|
||||
eq_(data['Sheet1'][0][0].days, 12)
|
||||
|
|
Loading…
Reference in New Issue