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

Conversation

Projects
None yet
2 participants
@jeeeyul
Contributor

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
@ichernev

View changes

lang/ko.js Outdated
@@ -51,6 +54,10 @@
y : "일년",
yy : "%d년"
},
ordinal : '%d일'
ordinal : '%d일',
meridiemParse : /(오전|오후)/i,

This comment has been minimized.

@ichernev

ichernev Dec 20, 2013

Contributor

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).

This comment has been minimized.

@jeeeyul

jeeeyul Dec 21, 2013

Contributor

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

Removed unecessary 'i' flag.
There is no capped letter in Korean.

ichernev added a commit that referenced this pull request Dec 21, 2013

Merge pull request #1362 from jeeeyul/develop
Meridiem Parser support for Korean

@ichernev ichernev merged commit 3592974 into moment:develop Dec 21, 2013

1 check passed

default The Travis CI build passed
Details
@ichernev

This comment has been minimized.

Contributor

ichernev commented Dec 21, 2013

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment