skiptools / skip-foundation Goto Github PK
View Code? Open in Web Editor NEWFoundation module for Skip apps.
Home Page: https://skip.tools
License: GNU Lesser General Public License v3.0
Foundation module for Skip apps.
Home Page: https://skip.tools
License: GNU Lesser General Public License v3.0
date(byAdding:value:to:wrappingComponents:)
Returns a new Date representing the date calculated by adding an amount of a specific component to a given date.
func date(
byAdding component: [Calendar](doc://com.apple.documentation/documentation/foundation/calendar).[Component](doc://com.apple.documentation/documentation/foundation/calendar/component),
value: [Int](doc://com.apple.documentation/documentation/swift/int),
to date: [Date](doc://com.apple.documentation/documentation/foundation/date),
wrappingComponents: [Bool](doc://com.apple.documentation/documentation/swift/bool) = false
) -> [Date](doc://com.apple.documentation/documentation/foundation/date)?
Parameters
component
A single component to add.
value
The value of the specified component to add.
date
The starting date.
wrappingComponents
If true, the component should be incremented and wrap around to zero/one on overflow, and should not cause higher components to be incremented. The default value is false.
Return Value
A new date, or nil if a date could not be calculated with the given input.
This API is not yet available in Skip.
Consider placing it within a #if !SKIP block.
You can file an issue against the owning library at https://github.com/skiptools,
or see the library README for information on adding support
The infoDictionary deriving from the Main Bundle package in Swift's Foundational Package is not available in Skip Yet.
Code example:
guard let currentAppVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String else {
return false
}
Unresolved reference: libs
Getting this error, even if I create an entirely new project in terminal and try to build it
Hi , I encountered a problem for loading this url(https://www.inquirer.net/fullfeed) in Android. On iOS, it worked.
Both status response for android and iOS was status 200.
Android error was
skip.lib.ErrorException:javax.net.ssl.SSLHandshakeExceptionChain validation failed
I tried a different url and it worked for both android and iOS.
May I know what this error mean? Note that this error is only on Android Emulator. when I run on an android actual device, it worked
(As reported by user on Gitter)
For URLRequest, this works on iOS:
var request = URLRequest(url: url)
request.httpMethod = requestMethod.rawValue
request.setValue(self.userAgent, forHTTPHeaderField: "User-Agent")
request.setValue("application/json", forHTTPHeaderField: "Accept")
if isLoggedIn {
request.setValue(jwt, forHTTPHeaderField: "Authorization")
}
request.httpBody = httpBody
let (data, response) = try await URLSession.shared.data(for: request)
But on android the body isn't available when viewing the request using Network Inspector and when logging the error I get:
skip.lib.ErrorException: java.io.FileNotFoundException: https://myurl
I got extensions
extension ClosedRange where Bound == Date {
func span(calendar: Calendar, units: Set<Calendar.Component>) -> Int {
let date1 = calendar.startOfDay(for: lowerBound)
let date2 = calendar.startOfDay(for: upperBound)
let components = calendar.dateComponents(units, from: date1, to: date2)
return components.day ?? 0
}
func toArray(calendar: Calendar) -> [Date] {
let date1 = calendar.startOfDay(for: lowerBound)
let date2 = calendar.startOfDay(for: upperBound)
let components = calendar.dateComponents([Calendar.Component.day], from: date1, to: date2)
let days = components.day ?? 0
guard days > 0 else { return [date1] }
var dates = [date1]
for i in 1 ... days {
// TODO: SKIP
if let nextDate = calendar.date(byAdding: Calendar.Component.day, value: i, to: date1) {
dates.append(nextDate)
}
}
return dates
}
}
which causes this
This API is not yet available in Skip. Consider filing an issue against the owning library at https://github.com/skiptools, or see the library README for information on adding support
However, other cases of calendar.date(byAdding
accross the app do not cause this?
caused at line
if let nextDate = calendar.date(byAdding: Calendar.Component.day, value: i, to: date1) {
dates.append(nextDate)
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.