Skip to content

Add implementation of NSTimeZone.init() with abbreviation #289

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

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

seabaylea
Copy link
Contributor

This adds an implementation of the following NSTimeZone.init() API:

 public convenience init?(abbreviation: String)

The implementation does a lookup of the abbreviation in the CFTimeZoneAbbreviationDictionary to generate a name and, if found, uses that to create a NSTimeZone instance. If no entry is found, we return nil.

I've also added two tests, one to check the negative (invalid abbreviation) case, and one to check the valid case using "AST" (the first entry in the dictionary).

@parkera
Copy link
Contributor

parkera commented Mar 16, 2016

@swift-ci please test

phausler added a commit that referenced this pull request Mar 21, 2016
Add implementation of NSTimeZone.init() with abbreviation
@phausler phausler merged commit f2672a7 into swiftlang:master Mar 21, 2016
@seabaylea seabaylea deleted the nstimezone branch March 21, 2016 15:07
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

Successfully merging this pull request may close these issues.

3 participants