Gelio / Gelio/cmp-natdat

Allow skipping the colon when parsing time

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
27
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Sometimes the colon is unnecessary when resolving the time.

- 725 -> 7:25
- 1420 -> 14:20
- 5 -> 5:00

Let's modify the time parser to account for these situations.

Sometimes this could lead to ambiguities:

- Oct 2 725 -> 725-10-2 (just the date) or 2023-10-02 7:25

I believe we should only make the colon optional when the format expects a time, so:

- after a relative date
- after a day of the week
- at the beginning of the query

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.