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

Express DateComponents in other time units (ex. x.seconds.in(.minute)) #337

Closed
leojkwan opened this issue Nov 23, 2016 · 1 comment
Closed
Assignees
Milestone

Comments

@leojkwan
Copy link

Is this still a feature? 120.seconds.in(.minutes)?

@malcommac malcommac changed the title Converting datecomponents Express DateComponents in other time units (ex. x.seconds.in(.minute)) Nov 30, 2016
@malcommac
Copy link
Owner

Yeah it will be available since 4.0.8 (this commit 6855337):

The signature is:

public func `in`(_ component: Calendar.Component, of calendar: CalendarName? = nil) -> Int?

Your example:

let x = 120.seconds.in(.minute)

@malcommac malcommac self-assigned this Nov 30, 2016
@malcommac malcommac added this to the 4.0.8 milestone Nov 30, 2016
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