jamesmills / laravel-timezone

Enable user Timezones in your application.
MIT License
675 stars 89 forks source link

Add diffForHumans function #53

Open jonnymccullagh opened 3 years ago

jonnymccullagh commented 3 years ago

I needed a diffForHumans function that would use the user timezone, so I added this function to my local version. Created PR in case you want to amend and merge. Feel free to close if not appropriate.

jamesmills commented 3 years ago

Hi @jonnymccullagh

Thanks for your contribution.

I would like to add this but I think we should do it slightly differently.

I think we should have your function call the convertToLocal function with an additional parameter.

I'll add it and you can let me know what you think.

jamesmills commented 3 years ago

No sure what I've managed to do here but I've added the my proposed refactor here

https://github.com/jamesmills/laravel-timezone/pull/63