Skip to content

[BUG] TimeReference.trLocationRef set to Nothing #101

@dcastro

Description

@dcastro

Description

When a time reference has a timezone abbreviation, and is then followed by some text with another timezone abbreviation, TimeReference.trLocationRef is set to Nothing

To Reproduce

This works as expected:

$ parseTimeRefs "MSK 4 pm"
[ TimeReference
    { trText = "MSK 4 pm"
    , trTimeOfDay = 16:00:00
    , trDateRef = Nothing
    , trLocationRef = Just
        ( TimeZoneAbbreviationRef
            ( TimeZoneAbbreviationInfo
                { tzaiAbbreviation = "MSK"
                , tzaiOffsetMinutes = 180
                , tzaiFullName = "Moscow Time"
                }
            )
        )
    }
]

But if we add , GMT at the end, then TimeReference.trLocationRef is set to Nothing.

$ parseTimeRefs "MSK 4 pm, in GMT"
[ TimeReference
    { trText = "MSK 4 pm"
    , trTimeOfDay = 16:00:00
    , trDateRef = Nothing
    , trLocationRef = Nothing
    }
]

Expected behavior

Expected parseTimeRefs "MSK 4 pm, in GMT" to return the same result as parseTimeRefs "MSK 4 pm"

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions