Navigation Menu

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 strings in add and subtract #1704

Merged
merged 1 commit into from Jun 12, 2014
Merged

Support strings in add and subtract #1704

merged 1 commit into from Jun 12, 2014

Conversation

ghost
Copy link

@ghost ghost commented Jun 8, 2014

This adds support for strings on add and subtract.

moment().add('1', 'h');
moment().subtract('1', 'h');
moment().add('h', '1');
moment().subtract('h', '1');

Notice that the value is a string. At the moment, doing the add would not do anything.

@ghost ghost changed the title Support strings in add and subract Support strings in add and subtract Jun 8, 2014
@ichernev
Copy link
Contributor

Well, the issue is that the initial interface was ('h', 1), and then we started supporting (1, 'h'), so we used the string type to distinguish the caller. We have to drop support for ('h', 1) in the next major.

The change looks good, though. Thank you @seriousben

ichernev added a commit that referenced this pull request Jun 12, 2014
…_in_add_subtract

Support strings in add and subtract

@changelog
@section features
@description support string type for numeric values in add/subtract
@ichernev ichernev merged commit 4677545 into moment:develop Jun 12, 2014
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.

None yet

1 participant