Skip to content

Commit

Permalink
update var names following review
Browse files Browse the repository at this point in the history
  • Loading branch information
8naama committed May 28, 2024
1 parent 150ba24 commit 5892a02
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,17 +101,17 @@ def _is_item_in_fetch_frame(self, item: dict, last_datetime_to_fetch: datetime)

def get_start_date_filter(self) -> str:
if self._current_data_last_date:
start_date_str = self._get_new_start_date()
new_start_date = start_date_str.split('.')[0].split('+')[0] # cut out milliseconds and timezone
if new_start_date == start_date_str:
new_start_date = start_date_str.split('%2E')[0].split('%2B')[0]
new_start_date += 'Z' if not new_start_date.endswith('Z') else ''
raw_new_start_date = self._get_new_start_date()
formatted_new_start_date = raw_new_start_date.split('.')[0].split('+')[0] # cut out milliseconds and timezone
if formatted_new_start_date == raw_new_start_date:
formatted_new_start_date = raw_new_start_date.split('%2E')[0].split('%2B')[0] # Support HTML encoded dates
formatted_new_start_date += 'Z' if not formatted_new_start_date.endswith('Z') else ''
else:
start_date = datetime.utcnow() - timedelta(days=self.base_data.settings.days_back_to_fetch)
new_start_date = start_date.isoformat(' ', 'seconds')
new_start_date = new_start_date.replace(' ', 'T')
new_start_date += 'Z'
return new_start_date
raw_new_start_date = datetime.utcnow() - timedelta(days=self.base_data.settings.days_back_to_fetch)
formatted_new_start_date = raw_new_start_date.isoformat(' ', 'seconds')
formatted_new_start_date = formatted_new_start_date.replace(' ', 'T')
formatted_new_start_date += 'Z'
return formatted_new_start_date

def _get_new_start_date(self) -> str:
new_start_date = str(parser.parse(self._current_data_last_date) + timedelta(seconds=1))
Expand Down

0 comments on commit 5892a02

Please sign in to comment.