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

MAGMA-172: Add method to obtain the duration between two dates or two datetime (maybe add support to minus method) #314

Open
ymarcon opened this issue Nov 29, 2011 · 1 comment
Milestone

Comments

@ymarcon
Copy link
Member

ymarcon commented Nov 29, 2011

Jira issue originally created by user @plaflamme:

Overload the minus method:
$('DATE').minus($('ANOTHER_DATE'))
or create a new specific method:
$('DATE').duration($('ANOTHER_DATE'))

@ymarcon
Copy link
Member Author

ymarcon commented Nov 29, 2011

Comment created by @plaflamme:

The result should have the proper unit (seconds for example) this way, one could convert them to other units:

// Compute the duration (in seconds) and convert to hours
$('DATE').duration($('ANOTHER_DATE')).toUnit('h')

@ymarcon ymarcon added this to the 2.0.0 milestone May 25, 2018
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

1 participant