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

Support Chinese time #30

Closed
wants to merge 1 commit into from
Closed

Conversation

quxiaolong1504
Copy link

Support Chinese time parse

Example:

AfterTime

后天中午
下月6号

Weekday

下周三 下下周二

@quxiaolong1504
Copy link
Author

@olebedev here

@olebedev
Copy link
Owner

olebedev commented Dec 5, 2022

Hey @quxiaolong1504,

Thank you for your contribution. However, I am not sure if I am qualified to verify the language-specific stuff here. From the perspective of the code structure and testing it looks good to me 👍

Before merging, I would like to see some test results. Can you rebase of this #31 so we can see in it your PR?

@quxiaolong1504
Copy link
Author

Hello @olebedev i rebase #31 . But the test was not triggered.

@olebedev
Copy link
Owner

No idea why it hasn't been triggered. I checked out the branch and got an error:

λ go test ./...
?   	github.com/olebedev/when	[no test files]
?   	github.com/olebedev/when/rules	[no test files]
ok  	github.com/olebedev/when/rules/br	0.724s
ok  	github.com/olebedev/when/rules/common	0.522s
ok  	github.com/olebedev/when/rules/en	1.318s
ok  	github.com/olebedev/when/rules/ru	1.029s
--- FAIL: TestExactMonthDate (0.00s)
    require.go:157: 
        	Error Trace:	zh_test.go:24
        	            				exact_month_test.go:33
        	Error:      	Not equal: 
        	            	expected: 0
        	            	actual  : 3
        	Test:       	TestExactMonthDate
        	Messages:   	[zh.ExactMonthDate] index #6
FAIL
FAIL	github.com/olebedev/when/rules/zh	1.517s
FAIL

@5idu
Copy link

5idu commented Dec 22, 2022

How is the issue going, this function is really great, looking forward to it!

@olebedev
Copy link
Owner

@quxiaolong1504, friendly ping

@olebedev
Copy link
Owner

Hello @5idu,

I noticed your interest in this feature. Would you be willing to take over from @quxiaolong1504 and work on it? I believe this is the only remaining step needed to complete it. That would be fantastic while we wait for @quxiaolong1504.

Best regards,
Oleg

@RexSkz
Copy link
Collaborator

RexSkz commented Jun 4, 2023

I'm also interested in this feature. I just found that test cases are triggered, but there's a bug in the code:

image

The source "十一月一日" (Nov 1st) is parsed to "一月一日" (Jan 1st), and the index is also wrong.

I'd like to help fixing it~

@olebedev
Copy link
Owner

olebedev commented Nov 3, 2023

Hey @quxiaolong1504, do you think this one is still relevant, given we already have most of the change landed in this #39 PR? Feel free to close it, if you think it's appropriate :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants