Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(parser): fixed error messages for parsing #21

Merged
merged 1 commit into from
Apr 1, 2024

Conversation

aj3sh
Copy link
Member

@aj3sh aj3sh commented Mar 31, 2024

While parsing the datetime string, it shows the wrong message in some cases. This PR fixes the error message.

Case 1: Out of Range Date

npTime, err := nepalitime.Parse("1800-01-01", "%Y-%m-%d")
# Output: datetime string did not match with given format
# Expected: date is out of range

Case 2: Datetime string without year

npTime, err := nepalitime.Parse("01-01 %k", "%m-%d %%k");
# Output: datetime string did not match with given format
# Expected: unable to parse year

@aj3sh aj3sh added the bug Something isn't working label Mar 31, 2024
@aj3sh aj3sh requested a review from sugat009 March 31, 2024 14:54
@aj3sh
Copy link
Member Author

aj3sh commented Mar 31, 2024

Ignore build codecov/patch

@subashcs subashcs merged commit 8a4517b into opensource-nepal:main Apr 1, 2024
2 of 3 checks passed
@aj3sh aj3sh deleted the parser-err-msg branch April 2, 2024 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants