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

Meridiem Parser support for Korean #1362

Merged
merged 6 commits into from
Dec 21, 2013
Merged

Meridiem Parser support for Korean #1362

merged 6 commits into from
Dec 21, 2013

Conversation

jeeeyul
Copy link
Contributor

@jeeeyul jeeeyul commented Dec 19, 2013

I found that almost of language datas can't support parse meridiem correctly now.
I made a fix and test case for Korean language data.

before this fix:

// PM 2
value = moment("오후 2시", "A h시", "ko").format("hh"); // => 02

with this fix:

// PM 2
value = moment("오후 2시", "A h시", "ko").format("hh"); // => 14

@@ -51,6 +54,10 @@
y : "일년",
yy : "%d년"
},
ordinal : '%d일'
ordinal : '%d일',
meridiemParse : /(오전|오후)/i,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Take a look at the English version:

meridiem : function (hours, minutes, isLower) {
    if (hours > 11) {
        return isLower ? 'pm' : 'PM';
    } else {
        return isLower ? 'am' : 'AM';
    }
},

I think you may want to do the same (becuase you used the i flag in the RegExp).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no capped letter in Korean. I removed unnecessary "i" flag.

There is no capped letter in Korean.
ichernev added a commit that referenced this pull request Dec 21, 2013
Meridiem Parser support for Korean
@ichernev ichernev merged commit 3592974 into moment:develop Dec 21, 2013
@ichernev
Copy link
Contributor

Thank you!

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

Successfully merging this pull request may close these issues.

None yet

2 participants