Skip to content

fix: add timezone indicator to backend date strings - #1344

Closed
TudorGR wants to merge 3 commits into
hasadna:mainfrom
TudorGR:fix/add-timezone-to-backend-dates
Closed

fix: add timezone indicator to backend date strings#1344
TudorGR wants to merge 3 commits into
hasadna:mainfrom
TudorGR:fix/add-timezone-to-backend-dates

Conversation

@TudorGR

@TudorGR TudorGR commented Nov 4, 2025

Copy link
Copy Markdown

Description

Fixes #1343

The backend returns dates in YYYY-MM-DDThh:mm:ss format without timezone information. This PR adds the 'Z' suffix to these date strings to indicate they are in GMT/UTC, ensuring correct timezone handling.

Changes:

  • Modified parseTime() function in src/api/gapsService.ts to append 'Z' to date strings that don't already have a timezone indicator
  • The fix checks if the time string already has a timezone (ends with 'Z' or contains '+') before adding 'Z'
  • Ensures backward compatibility with dates that already include timezone information

Technical details:

const timeString =
  typeof time === 'string' && !time.endsWith('Z') && !time.includes('+') ? `${time}Z` : time

This minimal change ensures all datetime strings from the backend are correctly interpreted as GMT/UTC before being converted to the Asia/Jerusalem timezone.

screenshots
N/A - This is a backend data parsing fix with no visible UI changes.

@TudorGR
TudorGR requested a review from AvivAbachi as a code owner November 4, 2025 08:19
@github-actions

github-actions Bot commented Nov 4, 2025

Copy link
Copy Markdown
Contributor

@AvivAbachi

AvivAbachi commented Nov 4, 2025

Copy link
Copy Markdown
Collaborator

@TudorGR @NoamGaash

  1. the backend fix fix: rides_execution not retune time whit time zone open-bus-stride-api#52
  2. because we are using @hasadna/open-bus-api-client is automacit convert it to Date

@NoamGaash

Copy link
Copy Markdown
Member

@AvivAbachi Great! Sorry for opening this issue I didn't notice your fix 👏

@AvivAbachi AvivAbachi closed this Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add timezone to time strings returned from the backend

3 participants