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

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

Closed
wants to merge 1 commit into from

Conversation

numeraltwo
Copy link

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

This PR is on the same wavelength as #1794

@maggiepint
Copy link
Member

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
Copy link

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
Copy link
Member

@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
Copy link

afilp commented May 31, 2016

+1

@numeraltwo
Copy link
Author

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
Copy link
Contributor

Merged in c37aa84

@ichernev ichernev closed this Jun 14, 2016
ichernev added a commit that referenced this pull request Jun 14, 2016
Allow user to get/set the rounding method used when calculating relative time
@mattjohnsonpint mattjohnsonpint 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants