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

Allow user to get/set the rounding method used when calculating relative time #2848

Closed
wants to merge 1 commit into
base: develop
from

Conversation

Projects
None yet
6 participants
@numeraltwo

numeraltwo commented Jan 3, 2016

There are many use cases where relative time humanization should use different rounding methods.

This PR is on the same wavelength as #1794

@mj1856 mj1856 added the Enhancement label Jan 30, 2016

@maggiepint

This comment has been minimized.

Member

maggiepint commented Mar 19, 2016

My apologies that we haven't gotten around to this one until now.

I don't take any issue with the code changes, but I am wondering, why in your tests do you change the default values for relative time threshold? Is it just to make it easier to see what is going on with the rounding functions?

@klardotsh

This comment has been minimized.

klardotsh commented May 18, 2016

What needs to be done to get this merged? I'd be willing to adopt this one to do simple fixes in the name of getting it merged; this kind of thing would make my life a lot easier on a current project.

@maggiepint

This comment has been minimized.

Member

maggiepint commented May 29, 2016

@iv597 I'm going to mark this for release. For the most part, I was just making sure someone still wanted it before merging it to cut down on bulk in the code. If you want it, I think it can go. That said, if @ichernev doesn't like something about the implementation when he reviews it before final release, I would ask you to make what changes he would like,

@afilp

This comment has been minimized.

afilp commented May 31, 2016

+1

@numeraltwo

This comment has been minimized.

numeraltwo commented May 31, 2016

Thanks all – I haven't been able to speak to this further because I have been super busy but I wanted to chime in as I realize my PR was a little terse. To clarify, my general use case for this was "pessimistic" countdowns (which you can see in the test cases). Not knowing Moment's internals super well the implementation feels a little bit patchy to me but the intent remains – there should be a simple way to change the core rounding function for humanization with another pure function.

@ichernev

This comment has been minimized.

Contributor

ichernev commented Jun 14, 2016

Merged in c37aa84

@ichernev ichernev closed this Jun 14, 2016

ichernev added a commit that referenced this pull request Jun 14, 2016

Merge pull request #2848 from numeraltwo:develop
Allow user to get/set the rounding method used when calculating relative time

@mj1856 mj1856 added this to the 2.14.0 milestone Jul 5, 2016

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