TimeSlotsCalculator is a package for dealing with new time slots for electricity in Spain.
Use the package manager SPM to add TimeSlotCalculator.
dependencies: [ .package(url: "https://github.com/Polenoso/TimeSlotCalculator.git", from: "1.0.0"), ], targets: .target("yourtarget", dependencies: [TimeSlotsCalculator])
import TimeSlotCalculator let calculator = TimeSlotsCalculator(holidays: ) let slot = try? calculator.getTimeSlot(for: Date())
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
|Last commit: 2 weeks ago|
This is the very first version of the package.
Includes basic usage to calculate the time slot from a given Date.
Currently it uses the Current device calendar to check whether it's a weekend or not.