Skip to content

Commit

Permalink
New configuration for CocoaPods and Carthage
Browse files Browse the repository at this point in the history
- New configuration for CocoaPods and Carthage
- Resolved a bug with time components algebra when one of the time components of a side is undefined
  • Loading branch information
dan committed Jul 6, 2017
1 parent 5565404 commit 057aafb
Show file tree
Hide file tree
Showing 79 changed files with 1,816 additions and 1,254 deletions.
Expand Up @@ -15,11 +15,13 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2016 Daniele Margutti. All rights reserved.</string>
<string>Copyright © 2017 Daniele Margutti. All rights reserved.</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
Expand Up @@ -16,6 +16,8 @@
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
Expand Down
2 changes: 1 addition & 1 deletion Package.swift
@@ -1,5 +1,5 @@
import PackageDescription

let package = Package(
name: "SwiftDate"
name: "SwiftDate"
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -125,6 +125,13 @@ public extension DateComponents {
if left != nil && right != nil && left != Int(NSDateComponentUndefined) && right != Int(NSDateComponentUndefined) {
let value = left! + (right! * multipler)
newCmps.setValue(value, for: component)
} else {
if left != nil && left != Int(NSDateComponentUndefined) {
newCmps.setValue(left!, for: component)
}
if right != nil && right != Int(NSDateComponentUndefined) {
newCmps.setValue(right!, for: component)
}
}
}
return newCmps
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -191,7 +191,8 @@ public class DateInRegionFormatter {
let isFuture = (fDate > tDate)
if cmp.year != nil && (cmp.year != 0 || !hasLowerAllowedComponents(than: .year)) {
let colloquial_time = try self.colloquial_time(forUnit: .year, withValue: cmp.year!, date: fDate)
let colloquial_date = try self.localized(unit: .year, withValue: cmp.year!, asFuture: isFuture, args: abs(fDate.year))
let value = (cmp.year == 1 ? cmp.year! : fDate.year)
let colloquial_date = try self.localized(unit: .year, withValue: value, asFuture: isFuture, args: abs(value))
return (colloquial_date,colloquial_time)
}

Expand All @@ -200,7 +201,7 @@ public class DateInRegionFormatter {
let colloquial_date = try self.localized(unit: .month, withValue: cmp.month!, asFuture: isFuture, args: abs(cmp.month!))
return (colloquial_date,colloquial_time)
}

if cmp.day != nil && (cmp.day != 0 || !hasLowerAllowedComponents(than: .day)) {
// Week ago
if cmp.day! >= DAYS_IN_WEEK {
Expand All @@ -216,9 +217,9 @@ public class DateInRegionFormatter {
}

if cmp.hour != nil && (cmp.hour != 0 || !hasLowerAllowedComponents(than: .hour)) {
let colloquial_time = try self.colloquial_time(forUnit: .hour, withValue: cmp.hour!, date: fDate)
let colloquial_date = try self.localized(unit: .hour, withValue: cmp.hour!, asFuture: isFuture, args: abs(cmp.hour!))
return (colloquial_date,colloquial_time)
let colloquial_time = try self.colloquial_time(forUnit: .hour, withValue: cmp.hour!, date: fDate)
let colloquial_date = try self.localized(unit: .hour, withValue: cmp.hour!, asFuture: isFuture, args: abs(cmp.hour!))
return (colloquial_date,colloquial_time)
}

if cmp.minute != nil && (cmp.minute != 0 || !hasLowerAllowedComponents(than: .minute)) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
175 changes: 0 additions & 175 deletions SwiftDate Playground.playground/Contents.swift

This file was deleted.

4 changes: 0 additions & 4 deletions SwiftDate Playground.playground/contents.xcplayground

This file was deleted.

35 changes: 18 additions & 17 deletions SwiftDate.podspec
@@ -1,18 +1,19 @@
Pod::Spec.new do |spec|
spec.name = 'SwiftDate'
spec.version = '4.1.2'
spec.summary = 'The best way to deal with Dates & Time Zones in Swift'
spec.homepage = 'https://github.com/malcommac/SwiftDate'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.author = { 'Daniele Margutti' => 'me@danielemargutti.com' }
spec.social_media_url = 'http://twitter.com/danielemargutti'
spec.source = { :git => 'https://github.com/malcommac/SwiftDate.git', :tag => "#{spec.version}" }
spec.source_files = 'Sources/**/*.swift'
spec.ios.deployment_target = '8.0'
spec.watchos.deployment_target = '2.0'
spec.osx.deployment_target = '10.10'
spec.tvos.deployment_target = '9.0'
spec.requires_arc = true
spec.module_name = 'SwiftDate'
spec.resource = 'Sources/SwiftDate/SwiftDate.bundle'
Pod::Spec.new do |s|
s.name = "SwiftDate"
s.version = "4.1.5"
s.summary = "The best way to deal with Dates & Time Zones in Swift"
s.homepage = "https://github.com/malcommac/SwiftDate"
s.license = { :type => "MIT", :file => "LICENSE" }
s.author = { "Daniele Margutti" => "me@danielemargutti.com" }
s.social_media_url = "http://twitter.com/danielemargutti"
s.ios.deployment_target = "8.0"
s.osx.deployment_target = "10.10"
s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0"
s.source = { :git => "https://github.com/malcommac/SwiftDate.git", :tag => s.version.to_s }
s.source_files = "Sources/**/*.swift"
s.frameworks = "Foundation"
s.requires_arc = true
s.module_name = 'SwiftDate'
s.resource = 'Sources/SwiftDate/SwiftDate.bundle'
end

0 comments on commit 057aafb

Please sign in to comment.