{"id":21374057,"url":"https://github.com/simla-tech/Fastis","last_synced_at":"2025-07-13T08:32:17.360Z","repository":{"id":42063192,"uuid":"255536390","full_name":"simla-tech/Fastis","owner":"simla-tech","description":"🗓 Simple date range \u0026 date picker / calendar powered by JTAppleCalendar","archived":false,"fork":false,"pushed_at":"2024-10-07T10:00:31.000Z","size":434,"stargazers_count":279,"open_issues_count":5,"forks_count":48,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-30T17:25:34.503Z","etag":null,"topics":["calendar","cocoapods","date","datepicker","daterange","daterangepicker","ios","jtapplecalendar","swift","xcode"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simla-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-04-14T07:10:19.000Z","updated_at":"2024-10-30T09:47:43.000Z","dependencies_parsed_at":"2024-01-15T15:36:03.724Z","dependency_job_id":"9d409204-e198-483e-9c17-37e5f5e2f65a","html_url":"https://github.com/simla-tech/Fastis","commit_stats":{"total_commits":119,"total_committers":9,"mean_commits":"13.222222222222221","dds":0.2941176470588235,"last_synced_commit":"f8302884026d3403d5cf3597a703326058e54e87"},"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simla-tech%2FFastis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simla-tech%2FFastis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simla-tech%2FFastis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simla-tech%2FFastis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simla-tech","download_url":"https://codeload.github.com/simla-tech/Fastis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225868607,"owners_count":17537084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calendar","cocoapods","date","datepicker","daterange","daterangepicker","ios","jtapplecalendar","swift","xcode"],"created_at":"2024-11-22T08:29:40.018Z","updated_at":"2024-11-22T08:30:09.257Z","avatar_url":"https://github.com/simla-tech.png","language":"Swift","funding_links":[],"categories":["OOM-Leaks-Crash"],"sub_categories":["Picker"],"readme":"\u003cimg alt=\"Fastis\" src=\"https://user-images.githubusercontent.com/4445510/187880045-cb66b662-095b-4173-b795-b1e732cc2166.png\" width=\"100%\"\u003e\n\n[![SwiftMP compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://github.com/apple/swift-package-manager)\n[![CocoaPods compatible](https://img.shields.io/cocoapods/v/Fastis.svg)](https://cocoapods.org/pods/Fastis)\n[![Swift](https://img.shields.io/badge/Swift-5-green.svg?style=flat)](https://swift.org)\n[![Xcode](https://img.shields.io/badge/Xcode-11-blue.svg?style=flat)](https://developer.apple.com/xcode)\n[![License](https://img.shields.io/badge/license-mit-brightgreen.svg?style=flat)](https://en.wikipedia.org/wiki/MIT_License)\n\nFastis is a fully customisable UI component for picking dates and ranges created using the [JTAppleCalendar](https://github.com/patchthecode/JTAppleCalendar) library.\n\n- [Requirements](#requirements)\n- [Features](#features)\n- [Android implementation](#android-implementation)\n- [Installation](#installation)\n- [Usage](#usage)\n\t- [Quick Start](#quick-start)\n\t- [Single and range modes](#single-and-range-modes)\n\t- [Configuration](#configuration)\n\t- [Shortcuts](#shortcuts)\n\t- [Customization](#customization)\n\t- [SwiftUI](#swiftui)\n- [Documentation](#documentation)\n- [Credits](#credits)\n- [License](#license)\n\n## Requirements\n\n- iOS 13.0+\n- Xcode 11.0+\n- Swift 5.0+\n\n## Features\n\n- [x] Flexible customization\n- [x] Shortcuts for dates and ranges\n- [x] Single date and date range modes\n- [x] Detailed [documentation](https://simla-tech.github.io/Fastis/documentation/fastis)\n\n## Android implementation\n\n* [appmonkey8010/AMCalendar](https://github.com/appmonkey8010/AMCalendar)\n\n## Installation\n\n### CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n\nTo integrate Fastis into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '13.0'\nuse_frameworks!\n\ntarget '\u003cYour Target Name\u003e' do\n    pod 'Fastis', '~\u003e 2.0'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n### Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nOnce you have your Swift package set up, adding Fastis as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`.\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/simla-tech/Fastis.git\", .upToNextMajor(from: \"2.0.0\"))\n]\n```\n\n### Carthage\n\nCarthage isn't supported.\n\n### Manually\n\nIf you prefer not to use either of the dependency managers mentioned above, you can manually integrate Fastis into your project.\n\n\n## Usage\n\n### Quick Start\n\n```swift\nimport Fastis\n\nclass MyViewController: UIViewController {\n\n    func chooseDate() {\n        let fastisController = FastisController(mode: .range)\n        fastisController.title = \"Choose range\"\n        fastisController.maximumDate = Date()\n        fastisController.allowToChooseNilDate = true\n        fastisController.shortcuts = [.today, .lastWeek]\n        fastisController.dismissHandler = { [weak self] action in\n            switch action {\n            case .done(let newValue):\n                ...\n            case .cancel:\n                ...\n            }\n        }\n        fastisController.present(above: self)\n    }\n\n}\n```\n\n### Single and range modes\n\nIf you want to get a single date, you have to use the `Date` type:\n\n```swift\nlet fastisController = FastisController(mode: .single)\nfastisController.initialValue = Date()\nfastisController.dismissHandler = { [weak self] action in\n    switch action {\n    case .done(let resultDate):\n        print(resultDate) // resultDate is Date\n    case .cancel:\n        ...\n    }\n}\n```\n\nIf you want to get a date range, you have to use the `FastisRange` type:\n\n```swift\nlet fastisController = FastisController(mode: .range)\nfastisController.initialValue = FastisRange(from: Date(), to: Date()) // or .from(Date(), to: Date())\nfastisController.dismissHandler = { [weak self] action in\n    switch action {\n    case .done(let resultRange):\n        print(resultRange) // resultRange is FastisRange\n    case .cancel:\n        ...\n    }\n}\n```\n\n### Configuration\n\nFastisController has the following default configuration parameters:\n\n```swift\nvar shortcuts: [FastisShortcut\u003cValue\u003e] = []\nvar allowsToChooseNilDate: Bool = false\nvar dismissHandler: ((DismissAction) -\u003e Void)? = nil\nvar initialValue: Value? = nil\nvar minimumDate: Date? = nil\nvar maximumDate: Date? = nil\nvar selectMonthOnHeaderTap: Bool = true\nvar allowDateRangeChanges: Bool = true\nvar closeOnSelectionImmediately: Bool = false\n```\n\n- `shortcuts`- Shortcuts array. The default value is `[]`. See [Shortcuts](#shortcuts) section\n- `allowsToChooseNilDate`- Allow to choose `nil` date. If you set `true`, the done button will always be enabled and you will be able to reset selection by you tapping on selected date again. The default value is `false`.\n- `dismissHandler`- The block to execute after the dismissal finishes. The default value is `nil`. Return DismissAction.done(FastisValue?) after the \"Done\" button will be tapped or DismissAction.cancel when controller dismissed without tapped the \"Done\" button.\n- `initialValue`- And initial value which will be selected by default. The default value is `nil`.\n- `minimumDate`-  Minimal selection date. Dates less than current will be marked as unavailable. The default value is `nil`.\n- `maximumDate`- Maximum selection date. Dates more significant than current will be marked as unavailable. The default value is `nil`.\n- `selectMonthOnHeaderTap` (Only for `.range` mode) - Set this variable to `true` if you want to allow select date ranges by tapping on months. The default value is `true`.\n- `allowDateRangeChanges` (Only for `.range` mode) - Set this variable to `false` if you want to disable date range changes. Next tap after selecting a range will start a new range selection. The default value is `true`.\n- `closeOnSelectionImmediately` (Only for `.single` mode) - Set this variable to `true` if you want to hide view of the selected date and close the controller right after the date is selected. The default value is `false`\n\n[Documentation Reference](https://simla-tech.github.io/Fastis/documentation/fastis/fastiscontroller)\n\n### Shortcuts\n\nUsing shortcuts allows you to select set dates or date ranges quickly.\nBy default `.shortcuts` is empty. The bottom container will be hidden if you don't provide any shortcuts.\n\nIn Fastis available some prepared shortcuts for each mode:\n\n- For **`.single`**: `.today`, `.tomorrow`, `.yesterday`\n- For **`.range`**: `.today`, `.lastWeek`, `.lastMonth`\n\nAlso, you can create your own shortcut:     \n\n```swift\nvar customShortcut = FastisShortcut(name: \"Today\") {\n    let now = Date()\n    return FastisRange(from: now.startOfDay(), to: now.endOfDay())\n}\nfastisController.shortcuts = [customShortcut, .lastWeek]\n```\n\n[Documentation Reference](https://simla-tech.github.io/Fastis/documentation/fastis/fastisshortcut)\n\n### Customization\n\nFastis can be customised global or local. `FastisConfig` have some sections:\n\n- `calendar` - Base calendar that used to render UI. Default value is `.current`.\n- `controller` - base view controller (`cancelButtonTitle`, `doneButtonTitle`, etc.)\n- `monthHeader` - month titles\n- `dayCell` - day cells (selection parameters, font, etc.)\n- `todayCell` - today cell (selection parameters, font, circle view, etc.). If you set `todayCell` to `nil`, view will use `dayCell` instead\n- `weekView` - top header view with weekday names\n- `currentValueView` - current value view appearance (clear button, date format, etc.)\n- `shortcutContainerView` - bottom view with shortcuts\n- `shortcutItemView` - shortcut item in the bottom view\n\nTo customise all Fastis controllers in your app, use `FastisConfig.default`:\n\n```swift\nFastisConfig.default.monthHeader.labelColor = .red\n```\n\nTo customise a special FastisController instance:\n\n```swift\nvar customConfig = FastisConfig.default\ncustomConfig.controller.dayCell.dateLabelColor = .blue\nlet fastisController = FastisController(mode: .range, config: customConfig)\n```\n\nTo customise a special FastisController instance with custom calendar:\n\n```swift\nvar customConfig: FastisConfig = .default\nvar calendar = Calendar(identifier: .islamicUmmAlQura)\ncalendar.locale = .autoupdatingCurrent\ncustomConfig.calendar = calendar\nlet fastisController = FastisController(mode: .range, config: customConfig)\nfastisController.minimumDate = calendar.date(byAdding: .month, value: -2, to: Date())\nfastisController.maximumDate = calendar.date(byAdding: .month, value: 3, to: Date())\n```\n\nTo customise a today cell:\n\n```swift\nlet config = FastisConfig.withCurrentDate\nconfig.todayCell.dateLabelColor = .red\nconfig.todayCell.onRangeLabelColor = .red\nconfig.todayCell.circleSize = 4\nconfig.todayCell.circleViewColor = .red\n```\n\nIf you don't want to customzie today date cell, just set `config.todayCell = nil` and today cell will use `dayCell` config.\n\n[Documentation Reference](https://simla-tech.github.io/Fastis/documentation/fastis/fastisconfig)\n\n### SwiftUI\n\nThe library also contains a SwiftUI wrapper\n\nIf you want to get a date range:\n\n```swift\nFastisView(mode: .single, dismissHandler: { action in\n    switch action {\n    case .done(let resultDate):\n        print(resultDate) // resultDate is Date\n    case .cancel:\n        ...\n    }\n})\n.title(\"Choose range\")\n.initialValue(self.currentValue as? FastisRange)\n.minimumDate(Calendar.current.date(byAdding: .month, value: -2, to: Date()))\n.maximumDate(Calendar.current.date(byAdding: .month, value: 3, to: Date()))\n.allowToChooseNilDate(true)\n.allowDateRangeChanges(false)\n.shortcuts([.lastWeek, .lastMonth])\n.selectMonthOnHeaderTap(true)\n```\n\nIf you want to get a single date:\n\n```swift\nFastisView(mode: .range, dismissHandler: { action in\n    switch action {\n    case .done(let resultRange):\n        print(resultRange) // resultRange is FastisRange\n    case .cancel:\n        ...\n    }\n})\n.title(\"Choose date\")\n.initialValue(self.currentValue as? Date)\n.minimumDate(Calendar.current.date(byAdding: .month, value: -2, to: Date()))\n.maximumDate(Date())\n.allowToChooseNilDate(true)\n.allowDateRangeChanges(false)\n.shortcuts([.yesterday, .today, .tomorrow])\n.closeOnSelectionImmediately(true)\n```\n\n[Documentation Reference]([https://simla-tech.github.io/Fastis/documentation/fastis/fastisconfig](https://simla-tech.github.io/Fastis/documentation/fastis/fastisview))\n\n## Documentation\n\nYou can use **detailed DocC documentation** which contains reference documentation about all components.\n\n[-\u003e Go to DocC documentation](https://simla-tech.github.io/Fastis/documentation/fastis/)\n\n## Credits\n\n- Ilya Kharlamov ([@ilia3546](https://github.com/ilia3546))\n- Uriy Devyataev ([@UriyDevyataev](https://github.com/UriyDevyataev))\n\n## License\n\nFastis is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimla-tech%2FFastis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimla-tech%2FFastis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimla-tech%2FFastis/lists"}