Skip to content

[$250] Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected #37657

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.46-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4360419
Email or phone of affected tester (no customers): sustinov@applausemail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:

Action Performed:

  1. Open https://staging.new.expensify.com/
  2. Log in with your HT account
  3. Navigate to your account settings
  4. Select the Profile menu
  5. Navigate to the Timezone menu
  6. Disable automatic location detection
  7. Select Timezone Asia/Almaty
  8. Create a new conversation
  9. Send a message to the conversation
  10. Match the time to https://time.is/Almaty

Expected Result:

If you select the time zone Asia/Almaty, the correct time UTC+5 should be displayed in the conversation

Expected Result:

Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6399216_1709362382452.IMG_001800.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~01f6b6a2a8c5d7e88b
  • Upwork Job ID: 1764447579559890944
  • Last Price Increase: 2024-03-04

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Mar 2, 2024
  2. melvin-bot commented on Mar 2, 2024

    @melvin-bot

    Triggered auto assignment to @mallenexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. lanitochka17 commented on Mar 2, 2024

    @lanitochka17
    Author

    We think that this bug might be related to #vip-vsp
    CC @quinthar

  4. lanitochka17 commented on Mar 2, 2024

    @lanitochka17
    Author

    @mallenexpensify FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

  5. added
    InternalRequires API changes or must be handled by Expensify staff
    on Mar 4, 2024
  6. melvin-bot commented on Mar 4, 2024

    @melvin-bot
  7. melvin-bot commented on Mar 4, 2024

    @melvin-bot

    Triggered auto assignment to Contributor Plus for review of internal employee PR - @Ollyws (Internal)

  8. mallenexpensify commented on Mar 4, 2024

    @mallenexpensify
    Contributor

    Unsure if we want to fix. @Ollyws if we do.. I'm assuming this would be a super-quick fix, do you agree?
    Checking on in #vip-vsp
    https://expensify.slack.com/archives/C066HJM2CAZ/p1709512189362859

  9. added
    ExternalAdded to denote the issue can be worked on by a contributor
    and removed
    InternalRequires API changes or must be handled by Expensify staff
    on Mar 4, 2024
  10. changed the title [-]Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected[/-] [+][$500] Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected[/+] on Mar 4, 2024
  11. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Mar 4, 2024
  12. 3 remaining items

  13. changed the title [-][$500] Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected[/-] [+][$250] Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected[/+] on Mar 4, 2024
  14. melvin-bot commented on Mar 4, 2024

    @melvin-bot

    Upwork job price has been updated to $250

  15. mallenexpensify commented on Mar 4, 2024

    @mallenexpensify
    Contributor

    Marked external, put starting price at $250 cuz I have a hunch this should be a pretty quick fix.
    Added to #vip-vsb

  16. garatkarr commented on Mar 4, 2024

    @garatkarr

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The time displayed in the chat page for Asia/Almaty is incorrect. It's off by 1 hour.

    What is the root cause of that problem?

    Kazakhstan has decided to unify the entire country under 1 timezone. This is a new change on March 1, 2024.

    What changes do you think we should make in order to solve the problem?

    User needs to update their browser (after manufacturer updates time zone definitions). I suspect the IANA time zone definitions are browser level but further investigation is needed.

    What alternative solutions did you explore? (Optional)

  17. abzokhattab commented on Mar 5, 2024

    @abzokhattab
    Contributor

    I think that should be fixed from the browser engine itself

    the date-fns-tz library uses Intl.DateTimeFormat to get the timezone offset as you can notice here it still returns +6

    image

    an alternative would be either to temporally delete the Asia/Almaty timezone here since Kazakhstan unified the timezone at the beginning of the month OR we add a special handling for the Almaty timezone where if selected the timezone +5 should be passed to the utcToZonedTime here

  18. askavyblr commented on Mar 5, 2024

    @askavyblr

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    The time displayed on the chat page for Asia/Almaty is incorrect.

    What is the root cause of that problem?

    The function getLocalDateFromDatetime does not return the time according to the specified time zone.

    What changes do you think we should make in order to solve the problem?

    need to change utcToZonedTime to zonedTimeToUtc , zonedTimeToUtc converts time from a specified time zone to UTC time.

    App/src/libs/DateUtils.ts

    Lines 119 to 122 in a8ece90

    function getLocalDateFromDatetime(locale: Locale, datetime?: string, currentSelectedTimezone: SelectedTimezone = timezone.selected): Date {
    setLocale(locale);
    if (!datetime) {
    const res = utcToZonedTime(new Date(), currentSelectedTimezone);

    What alternative solutions did you explore? (Optional)
    N/A

    Fix5.mp4
  19. Ollyws commented on Mar 5, 2024

    @Ollyws
    Contributor

    As @abzokhattab pointed out the date-fns-tz library uses Intl.DateTimeFormat to get the timezone, which seems to get its data from https://www.iana.org/time-zones which hasn't been updated since Kazakhstan unified it's timezone.
    I think we can just leave this one and it should be fixed upstream as updates roll out.

  20. mallenexpensify commented on Mar 7, 2024

    @mallenexpensify
    Contributor

    I think we can just leave this one and it should be fixed upstream as updates roll out.

    I agree, I'm going to close this. Thanks @abzokhattab @Ollyws and others for the feedback

  21. shubham1206agra commented on May 14, 2024

    @shubham1206agra
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Time - Incorrect time is displayed in the conversation when Timezone Asia/Almaty is selected

    What is the root cause of that problem?

    The time displayed in the chat page for Asia/Almaty is incorrect. It's off by 1 hour as Kazakhstan has decided to unify the entire country under 1 timezone. This is a new change on March 1, 2024.

    This will not be fixed upstream as we use @formatjs/intl-datetimeformat for polifilling Intl.DateTimeFormat on web and ios platform.

    New tzdata was included in formatjs/formatjs@5a478ff, which includes the new timezone for Asia/Almaty.

    What changes do you think we should make in order to solve the problem?

    Update the package @formatjs/intl-datetimeformat to v6.12.3.

    What alternative solutions did you explore? (Optional)

    NA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsReviewingHas a PR in reviewWeeklyKSv2

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions