File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
Sources/AlgoliaSearchClient/Helpers/FoundationConvenience
Tests/AlgoliaSearchClientTests/Doc/Methods Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 77
88import Foundation
99
10- public extension TimeInterval {
10+ extension TimeInterval {
1111
1212 var milliseconds : Int64 {
1313 return Int64 ( ( self * 1000.0 ) . rounded ( ) )
1414 }
1515
1616}
1717
18- public extension TimeInterval {
18+ extension TimeInterval {
1919
2020 static let hour : TimeInterval = minute * 60
2121
@@ -25,7 +25,7 @@ public extension TimeInterval {
2525
2626}
2727
28- public extension TimeInterval {
28+ extension TimeInterval {
2929
3030 static let minute : TimeInterval = 60
3131
@@ -35,7 +35,7 @@ public extension TimeInterval {
3535
3636}
3737
38- public extension TimeInterval {
38+ extension TimeInterval {
3939
4040 static let second : TimeInterval = 1
4141
@@ -45,7 +45,7 @@ public extension TimeInterval {
4545
4646}
4747
48- public extension TimeInterval {
48+ extension TimeInterval {
4949
5050 static let day : TimeInterval = hour * 24
5151
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ extension ABTestSnippets {
5353 let analyticsClient = AnalyticsClient ( appID: " YourApplicationID " , apiKey: " YourAdminAPIKey " )
5454
5555 let abTest = ABTest ( name: " myABTest " ,
56- endAt: Date ( ) . addingTimeInterval ( . day ) ,
56+ endAt: Date ( ) . addingTimeInterval ( 24 * 60 * 60 ) ,
5757 variantA: . init( indexName: " indexName1 " ,
5858 trafficPercentage: 90 ,
5959 description: " a description " ) ,
@@ -72,7 +72,7 @@ extension ABTestSnippets {
7272 let analyticsClient = AnalyticsClient ( appID: " YourApplicationID " , apiKey: " YourAdminAPIKey " )
7373
7474 let abTest = ABTest ( name: " myABTest " ,
75- endAt: Date ( ) . addingTimeInterval ( . day ) ,
75+ endAt: Date ( ) . addingTimeInterval ( 24 * 60 * 60 ) ,
7676 variantA: . init( indexName: " indexName1 " ,
7777 trafficPercentage: 90 ,
7878 description: " a description " ) ,
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ extension APIKeysSnippets {
4747
4848 let parentAPIKey = APIKey ( " SearchOnlyApiKeyKeptPrivate " )
4949 let restriction = SecuredAPIKeyRestriction ( )
50- . set ( \. validUntil, to: Date ( ) . addingTimeInterval ( . hour ) . timeIntervalSince1970)
50+ . set ( \. validUntil, to: Date ( ) . addingTimeInterval ( 60 * 60 ) . timeIntervalSince1970)
5151
5252 let publicKey = client. generateSecuredApiKey ( parentApiKey: parentAPIKey, with: restriction)
5353 _ = publicKey//to remove when pasted to doc
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ extension RulesSnippets {
3737 )
3838 . set ( \. validity, to: [
3939 TimeRange ( from: Date ( ) ,
40- until: Date ( ) . addingTimeInterval ( . days ( 10 ) ) )
40+ until: Date ( ) . addingTimeInterval ( 10 * 24 * 60 * 60 ) )
4141 ]
4242 )
4343
You can’t perform that action at this time.
0 commit comments