Skip to content

Chat message time shows "00:30 AM" for 12:30 PM #1709

Open

Description

@RaphaelFakhri

getTimeStringin12HourFormat in packages/react-native-room-kit/src/utils/functions.tsx formats the time shown under each chat message.

Actual results:

  • A message sent at 12:30 PM shows 00:30 AM.
  • A message sent at 12:05 AM shows 00:05 AM.

Expected results: 12:30 PM and 12:05 AM.

Cause: the notation check hours / 12 > 1 is false when hours is 12, and hours % 12 yields 0 for both 0 and 12 without mapping it to 12. Using hours >= 12 and hours % 12 || 12 fixes both cases.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions