[GH-ISSUE #4720] [Bug] Time Parser Fails to Correctly Parse 12-Hour Format #2118

Closed
opened 2026-03-23 21:19:49 +00:00 by mirror · 1 comment
Owner

Originally created by @AnsahMohammad on GitHub (Feb 23, 2024).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4720

Originally assigned to: @richardshiue on GitHub.

Bug Description

The time parser encounters issues when the user opts for the 12-hour format. The current implementation struggles to parse time input in the 'HH:mm a' format.

How to Reproduce

  1. Select the Time format as 12 Hour format (from user settings)
  2. Enter the time in the time field "08:00 PM"
    Then the time gets parsed as "08:00 AM"

Expected Behavior

When given input "08:00 PM"
The parser should parse the input to "08:00 PM"

Operating System

Ubuntu LTS 22.04

AppFlowy Version(s)

0.4.9

Screenshots

Screencast from 24-02-24 12:22:26 AM IST.webm

Additional Context

From the code, The twelve Hour format is not being recognized by the if condition
image

Originally created by @AnsahMohammad on GitHub (Feb 23, 2024). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/4720 Originally assigned to: @richardshiue on GitHub. ### Bug Description The time parser encounters issues when the user opts for the 12-hour format. The current implementation struggles to parse time input in the 'HH:mm a' format. ### How to Reproduce 1. Select the Time format as 12 Hour format (from user settings) 2. Enter the time in the time field "08:00 PM" Then the time gets parsed as "08:00 AM" ### Expected Behavior When given input "08:00 PM" The parser should parse the input to "08:00 PM" ### Operating System Ubuntu LTS 22.04 ### AppFlowy Version(s) 0.4.9 ### Screenshots [Screencast from 24-02-24 12:22:26 AM IST.webm](https://github.com/AppFlowy-IO/AppFlowy/assets/85027826/ca513458-6a29-4d59-b2d1-e8c48510f015) ### Additional Context From the code, The twelve Hour format is not being recognized by the if condition ![image](https://github.com/AppFlowy-IO/AppFlowy/assets/85027826/4a9a867d-378c-4029-ad01-e6824e83232a)
mirror 2026-03-23 21:19:49 +00:00
Author
Owner

@maxweilun1989 commented on GitHub (Feb 28, 2024):

@richardshiue hi, do you work on this? I debug for a while and found the root cause of this may be the timeFormat variable passed in is not the same object of TimeFormatPB.TwelveHour.
using

timeFormat.value == TimeFormatPB.TwelveHour.value

may fix the problem. But I'm not sure if it's the proper or not?

<!-- gh-comment-id:1968308484 --> @maxweilun1989 commented on GitHub (Feb 28, 2024): @richardshiue hi, do you work on this? I debug for a while and found the root cause of this may be the `timeFormat` variable passed in is not the same object of TimeFormatPB.TwelveHour. using ```dart timeFormat.value == TimeFormatPB.TwelveHour.value ``` may fix the problem. But I'm not sure if it's the proper or not?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#2118
No description provided.