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

Refactor/chinese taiwan language #28

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

boonsanti
Copy link

No description provided.

@goodsign
Copy link
Owner

Hey @boonsanti

Thank you for your request! Can you please add/run some unit tests for this in the https://github.com/goodsign/monday/blob/master/monday_test.go file?

@mikejamesli
Copy link

mikejamesli commented Jul 1, 2020

Hey @boonsanti @goodsign @boyzfunhouse

I am also looking for th_TH support, so I checked the unit tests @boonsanti added which look fine on the surface:

{LocaleThTH, time.Date(2013, 9, 3, 0, 0, 0, 0, time.UTC), "Mon Jan 2 2006", "อ ก.ย. 3 2013"},

The tests fail due to a mismatch in length for the return array of stringToLayoutItems:

func commonFormatFunc(value, format string, knownDaysShort, knownDaysLong, 
knownMonthsShort, knownMonthsLong, knownPeriods map[string]string) (res string) {

	l := stringToLayoutItems(value)
	f := stringToLayoutItems(format)

	if len(l) != len(f) {
		return value // layouts does not matches
	}

l returns 9 whereas f returns 7. This is because the period characters '.' in ก.ย. are being treated as separate items when this month short format should be treated as one item.

Any ideas on how to fix this?

@goodsign
Copy link
Owner

goodsign commented Jul 2, 2020

Hey @mikejamesli

Thank you for finding this, I'm unavailable at the moment, unfortunately, but I should be able to find time to accept a PR, so can someone please check this?

Thanks!

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.

4 participants