Commit 509b57b654e813e4c547373e1937d354e52dd0b2
1 parent
f2410a33
Rename vars: data1, data2 -> date1, date2
Showing
1 changed file
with
9 additions
and
9 deletions
@@ -53,15 +53,15 @@ def prepare_prom_test_tender_data(period_intervals, mode): | @@ -53,15 +53,15 @@ def prepare_prom_test_tender_data(period_intervals, mode): | ||
53 | return munchify({'data': t_data}) | 53 | return munchify({'data': t_data}) |
54 | 54 | ||
55 | 55 | ||
56 | -def compare_date(data1, data2): | ||
57 | - data1 = parse(data1) | ||
58 | - data2 = parse(data2) | ||
59 | - if data1.tzinfo is None: | ||
60 | - data1 = TZ.localize(data1) | ||
61 | - if data2.tzinfo is None: | ||
62 | - data2 = TZ.localize(data2) | ||
63 | - | ||
64 | - delta = (data1 - data2).total_seconds() | 56 | +def compare_date(date1, date2): |
57 | + date1 = parse(date1) | ||
58 | + date2 = parse(date2) | ||
59 | + if date1.tzinfo is None: | ||
60 | + date1 = TZ.localize(date1) | ||
61 | + if date2.tzinfo is None: | ||
62 | + date2 = TZ.localize(date2) | ||
63 | + | ||
64 | + delta = (date1 - date2).total_seconds() | ||
65 | if abs(delta) > 60: | 65 | if abs(delta) > 60: |
66 | return False | 66 | return False |
67 | return True | 67 | return True |
Please
register
or
login
to post a comment