simla-tech / fastis Goto Github PK
View Code? Open in Web Editor NEW🗓 Simple date range & date picker / calendar powered by JTAppleCalendar
License: MIT License
🗓 Simple date range & date picker / calendar powered by JTAppleCalendar
License: MIT License
private func chooseRange() { var customConfig = FastisConfig.default customConfig.calendar = Calendar(identifier:.islamicUmmAlQura) let fastisController = FastisController(mode: .range, config: customConfig) fastisController.title = "Choose range" fastisController.initialValue = self.currentValue as? FastisRange fastisController.allowToChooseNilDate = true fastisController.shortcuts = [.today, .lastWeek, .lastMonth] fastisController.dismissHandler = { [weak self] action in switch action { case .done(let newValue): self?.currentValue = newValue case .cancel: print("any actions") } } fastisController.present(above: self) }
I change the calendar identifier from gregorian to islamicUmmAlQura but still display gregorian & i make the FastisConfig default to customize that
If Fastis is added to an application via SPM it crashes after opening the calendar view.
In FastisConfig.CurrentValueView
there is a definition of an image:
public var clearButtonImage: UIImage = UIImage(named: "icon_clear")!
This line will crash after opening the calendar view since in UIImage + BundleInit.swift
extension, bundle is accessed in an incorrect way. For example, if an application MyApp links Fastis via SPM this extension, this extension will attempt to check if there is an image named "icon_clear"
in the MyApp bundle, not in Fastis package.
fileprivate class BundleId {}
extension UIImage {
internal convenience init?(named: String) {
let podBundle = Bundle(for: BundleId.self)
self.init(named: named, in: podBundle, compatibleWith: nil)
}
}
After some research I have found that most likely instead of using Bundle(for: BundleId.self)
, Bundle.module
should be used. It is suggested in Apple Documentation and in this StackOverflow post and also in this thread.
Hi,
i have an issue when using different time zone then current device has eg:
var customConfig = FastisConfig.default
..
customConfig.calendar.timeZone = TimeZone(secondsFromGMT: 0)!
when picking range it display correct values eg(1st November 2023 -> 30 November 2023) but on top i see the wrong interval
1 November - 1 December
is there anything that i can do, or at least hide the interval label
In my case I need to perform different actions for cancel and done completion blocks. It could be simply implemented if your libary had one block for 2 actions with variable "isCancelled" or "isSuccess" or if there were 2 separate blocks for actions.
Instead your library has doneHandler
and dismissHandler
. In case of cancel dismissHandler
is called only, in case of done
they are both called and I need somehow to check if "dismiss" is called separately or immediately after "done"
When the selection range is large, the rendering time of the interface is very long, as if it is stuck.
Doesn't Fastis need a Privacy Manifest?
'tertiaryLabel' is only available in iOS 13.0 or newer
Using Fastis 3.1.0
class FastisConfig
file name - Current value view
line no. - 154
there is force unwrapping
public var clearButtonImage: UIImage = UIImage(named: "icon_clear")!
could you please fix this issue?
Thanks
is there an easy way to choose language, or change specific strings?
Hi? Thank you making good library.
I want to add left and right arrow button.
It's convenient to show previous month or next month.
Scrolling didn't locate in right position.
Is it possible in .range mode to not select the same day for start and end (allowed selected range to be at least 2 days long)
When two dates are selected it would be nice to be able to drag one of the dates to change it.
Hello? I want to show date until this date on calendar.
calendarConroller.maximumDate = Date()
If date is Sep 6 and it show Oct 5.
I don't want to show future month.
Is there any way ?
When I try to add the package with the Swift Package Manager in Xcode I get an error: invalidMainfestFormat
. You have to change this platforms: [ .iOS(.v13) ]
to this platforms: [ .iOS(.v12) ]
in the Package.swift file.
It always gives 19:00:00 +0000.
I want current time, is there any fix for this?
I would love to see the feature to customize the look of current day in the month view. I didn't find anything related in the configuration. Do you think you could add that feature?
Currently we have Monday as first day of week , I want to make as Sunday as first day. Is it possible?
Hello,
It seems that done button is not visible in iOS versions above 17.0.
Does anyone have an idea what is the issue?
Im getting weird behaviour that I cannot figure out... Fastis used to work perfectly and now I have noticed that its not working at all in any of my views, neither UIKit or SwiftUI
I have the following view made based on the SwiftUI section on the README
struct CalendarDatePickerSheetView: View {
@Binding
var date: Date?
var body: some View {
FastisView(mode: .single) {
switch $0 {
case let .done(selectedDate):
guard let selectedDate = selectedDate else { return }
date = selectedDate
case .cancel:
break
}
}
.title(L10n.Creator.Common.chooseDate)
.initialValue(date)
.minimumDate(Date())
.allowToChooseNilDate(false)
}
}
then call it as follows
.sheet(isPresented: $vm.isEndDatePickerPresented) {
CalendarDatePickerSheetView(date: $vm.endDate)
}
and when I press the button in simulator it loads the FastisView and then crashes a second or two later and in simulator it crashes the preview instantly
If I add an all exceptions breakpoint the crash happens in JTACMonthActionFunctions.swift:97
inside scrollToHeaderInSection
and the error message is
-[JTAppleCalendar.JTACMonthView scrollViewDidEndScrollingAnimation:]: unrecognized selector sent to instance 0x10bc45000
I unfortunately have no idea why this would happen specifically on this screen and not the other so if you have any ideas what would be causing this it would be greatly appreciated
im trying to use this package but itds forcing me to use sheets to get the done callback can we get a customization for blending it in view? maybe onDateChanged callbacks?
Unable to get start date from Fastis dismiss handler
Anyway to use this library (plug and play) for swift ui ? Any example will be helpful.
I am using the single mode for the calendar and have come to the realization that the currentValueView is, in fact, redundant, as users can already view the date they have chosen. I believe introducing this option would grant users increased flexibility to tailor the application's appearance and functionality, aligning them more closely with their individual preferences and needs.
Many thanks for this great framework.
Hi. I need to edit shortcuts names in my spoken language.
I cannot find a way. It seems to me that they're not customizable.
Can anyone help me?
Thanks
I have the requirement for the user to be able to select a date range so that start and end are within the same date (end to be start + 3hours). Is this currently possible in .range mode? I found that selecting start and end on the same date, returns nil for range.
Hello,
I have just upgraded to Xcode 15.4 and unable to build my project because of the JTAppleCalendar error.
JTCalendar has already fixed this issue as shown on below link with 8.0.5 but Fastis still installs 8.0.4 as you see in the screenshot.
patchthecode/JTAppleCalendar#1383
Thank you for your help.
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.