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

More formats #5

Open
dirkluijk opened this issue Jul 17, 2014 · 1 comment
Open

More formats #5

dirkluijk opened this issue Jul 17, 2014 · 1 comment

Comments

@dirkluijk
Copy link

What is your opinion about this style of human dates?

Date transformation (compared to now)

2 days ago
1 week ago
in 4 days

Date transformation (compared to another date)

2 days before
1 week before
4 days later

Timespan

0 years, 3 months, 1 week, 1 day, 3 hours, 20 minutes, 0 seconds

See https://github.com/jenssegers/laravel-date
for more examples.

It would be great to have it all in one place. Is it a good idea to extend this library to provide both styles?

If yes, I think the transform method could be extended with a $specific parameter, and new methods like compare (or diff) and timespan should be added.

@florianeckerstorfer
Copy link
Member

The library is currently really simple because when I first wrote it I didn't need more functionality. I guess additional formats would be useful but I think this would require some major refactoring because much of the format is kind of hard coded into the code. Any ideas how we could approach this?

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

No branches or pull requests

2 participants