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 for Chuvash suffix changes in future fromNow #398

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
4 participants
@mirontoli
Copy link
Contributor

mirontoli commented Aug 16, 2012

Chuvash uses an affix to express the future "fromNow". This affix can have different forms depending on preceeding sound. I wrote about this issue in my blog post: Chuvash localization of moment.js. To solve this, the core moment.js has to support custom logic for future expressions.

In this PR I added tests for this for Chuvash, changes in lang/cv.js (a function instead of a string) and a change in "humanize" function in moment.js file.

@travisbot

This comment has been minimized.

Copy link

travisbot commented Aug 16, 2012

This pull request passes (merged c6ac5b1 into b661e8d).

@@ -1047,10 +1047,16 @@
humanize : function (withSuffix) {
var difference = +this,
rel = this.lang().relativeTime,
output = relativeTime(difference, !withSuffix, this.lang());
output = relativeTime(difference, !withSuffix, this.lang()),
fromNow = difference <= 0 ? rel.past : rel.future;

This comment has been minimized.

Copy link
@mirontoli

mirontoli Aug 16, 2012

Author Contributor

fromNow variable was placed inside next if statement. Unfortunately I could not run make test: jshintc complained ("One var is to much"). So "fromNow" is now placed here.

@rockymeza

This comment has been minimized.

Copy link
Contributor

rockymeza commented Aug 17, 2012

I think this could sneak into the 1.7.1 release, @timrwood what do you think? This seems to be a very good addition, that minimally affects filesize. Also, @travisbot likes it.

@timrwood

This comment has been minimized.

Copy link
Member

timrwood commented Aug 17, 2012

Yeah, sounds good. I'll manually pull it into the hotfix/1.7.1 branch.

@timrwood

This comment has been minimized.

Copy link
Member

timrwood commented Aug 19, 2012

This has been merged into the hotfix/1.7.1 branch.

@timrwood timrwood closed this Aug 19, 2012

@timrwood timrwood referenced this pull request Aug 19, 2012

Closed

1.7.1 Changelog #384

@mirontoli

This comment has been minimized.

Copy link
Contributor Author

mirontoli commented Aug 20, 2012

Thanks, guys, for the quick response and action. I am more than satisfied.

@timrwood

This comment has been minimized.

Copy link
Member

timrwood commented Oct 1, 2012

This has been released with 1.7.1. #384

@mirontoli

This comment has been minimized.

Copy link
Contributor Author

mirontoli commented Oct 2, 2012

Perfect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.