GithubHelp home page GithubHelp logo

modernistik / timezonelocate Goto Github PK

View Code? Open in Web Editor NEW
36.0 8.0 13.0 100 KB

Time zone for locations offline in Swift (iOS).

Home Page: https://github.com/modernistik/TimeZoneLocate

License: MIT License

Ruby 14.89% Swift 85.11%
timezone swift ios time-zones location

timezonelocate's Introduction

Modernistik Cocoa Framework

This framework represents extensions, utilities, design patterns and practices adopted for Modernistik software development in Swift.

Installation

You can install Modernistik in two forms: Cocoapods or using Swift Package Manager.

Swift Package Manager

Modernistik is available as a Swift Package on XCode 12 and later. Add the repository url to the list of Swift packages in XCode.

Cocoapods

Modernistik is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'Modernistik', '~> 0.5' # Swift 5+

Author

Anthony Persaud, https://www.modernistik.com

timezonelocate's People

Contributors

apersaud avatar janc avatar jawwad avatar mamnun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

timezonelocate's Issues

Coos Bay Oregon returns Boise TZ

My Swift project requires time zones from locations and TimeZoneLocate works great until I visited Coos Bay Oregon. Location 43.39968207,-124.21942656 which returned Boise

Portland Oregon returns Vancouver
San francisco returns Los Angeles
New York returns New York are all correct

Please review

Regards

John James
[email protected]

Stack Overflow when country code is nil?

I did this:

TimeZoneLocate.timeZone(location: CLLocation(latitude: 0, longitude: 0))

And then when this is run, the stack overflew.

I looked at the implementation of the method and saw that it will always cause a stack overflow when country code is nil:

open class func timeZone(location:CLLocation, countryCode:String? = nil) -> TimeZone? {
    
    //Need a countr
    guard let countryCode = countryCode,
        //Filter
        let filteredZones = filteredTimeZones(countryCode:countryCode),
        //Get closest zone info
        let closestZoneInfo = closestZoneInfo(location:location, source:filteredZones),
        //get timzone
        let timeZone = timeZoneWithDictionary(closestZoneInfo)
    else { return self.timeZone(location: location)}
    
    return timeZone
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.