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

Add additional methods to mutate time & distance #3

Open
ash123456789 opened this issue Dec 13, 2018 · 1 comment
Open

Add additional methods to mutate time & distance #3

ash123456789 opened this issue Dec 13, 2018 · 1 comment

Comments

@ash123456789
Copy link

ash123456789 commented Dec 13, 2018

It would be very convenient if you could mutate the time that is calculated, without needing to perform additional processing of the data outside of the package.

Time

If we use the demo as an example, it currently returns the information in seconds. What I propose would do the following.

$journey->duration()->toMinutes()

This would then return, for example, 5 mins. Additional options would also be really handy, e.g. toHours().

Distance

Something similar could also be done to the distance.

$journey->distance()->toMiles()
@ash123456789 ash123456789 changed the title Add additional methods to mutate time estimates & distance Add additional methods to mutate time & distance Dec 13, 2018
@DivineOmega
Copy link
Contributor

This is a good idea.

However, the current duration() and distance() methods do not return objects, so we could not chain methods in this manner. It's also worth considering it we want to apply this functionality to the Journey Steps as well.

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

No branches or pull requests

2 participants