An easy to use SwiftUI date picker for Shamsi (Persian) calendar

Overview

ShamsiDatePicker

An easy-to-use SwiftUI iOS/watchOS date picker for Shamsi (Persian) calendar.

ShamsiDatePicker in iOS ShamsiDatePicker in iOS with Dark Mode

ShamsiDatePicker in Apple Watch ShamsiDatePicker in Apple Watch used in a `Form` view

Features

  • Pure (100%) SwiftUI implementation
  • Full support for Shamsi (Persian) calendar, including weekday names and leap years
  • Easy to customize various properties, such as minimum and maximum date allowed
  • Simple to use in various views by adding a single line of code
  • Support for both iOS (13.0 +) and watchOS (7.0 +) apps with great-looking styles
  • Compact style when used in watchOS Forms

Installation

ShamsiDatePicker can easily be installed using Swift Package Manager (SPM).

  1. Open your project in Xcode.
  2. Click File -> Swift Packages -> Add Package Dependency...
  3. Add https://github.com/spneshaei/ShamsiDatePicker.git as a package

Usage

Basic Usage

To use ShamsiDatePicker in a SwiftUI view, you should import ShamsiDatePicker first:

import ShamsiDatePicker

Then, you can start using ShamsiDatePicker:

struct ContentView: View {
    @State var date = Date()
    
    var body: some View {
        ShamsiDatePicker(selectedDate: $date)
    }
}

Setting a Range of Supported Dates

To specify the minimum and maximum possible-to-select dates from ShamsiDatePicker, you can specify those dates in ShamsiDatePickers initializer:

ShamsiDatePicker(selectedDate: $date, minDate: Date(timeIntervalSince1970: 0), maxDate: Date())

Using ShamsiDatePicker in SwiftUI Forms

ShamsiDatePicker works with SwiftUI Forms out of the box. When using ShamsiDatePicker in watchOS, using ShamsiDatePicker in a Form will result in a compact date picker, suitable for the Apple Watch's small display. When you use ShamsiDatePicker outside of the Form view, ShamsiDatePicker will be rendered as a wheel scrolling view, similar to its iOS counterpart.

License

To see the license which is applied to all the files in the current repository, open LICENSE.

You might also like...
The elegant full screen calendar missed in SwiftUI.
The elegant full screen calendar missed in SwiftUI.

ElegantCalendar ElegantCalendar is an efficient and customizable full screen calendar written in SwiftUI. ElegantTimeline - Shows what's possible usin

A customizable swiftui calendar
A customizable swiftui calendar

Description not available. Installation From Xcode 11, you can use Swift Package Manager to add Kingfisher to your project. Select File Swift Packag

SwiftUICalendar - SwiftUI simple calendar
SwiftUICalendar - SwiftUI simple calendar

SwiftUICalendar Installation CocoaPods pod 'SwiftUICalendar' import import SwiftUICalendar Features Infinite scroll Support horizontal and vertical sc

Clendar - universal calendar app. Written in SwiftUI. Available on App Store. MIT License.

Clendar - minimal calendar Minimal Calendar & Widgets Landing Page About This project is started out as an UIKit base app for me to learn new WWDC fea

πŸ“… Calendar for iOS, iPadOS and macOS in Swift
πŸ“… Calendar for iOS, iPadOS and macOS in Swift

CalendarKit CalendarKit is a Swift calendar UI library for iOS, iPadOS and Mac Catalyst. It looks similar to the Apple Calendar app out-of-the-box, wh

Dead simple calendar implementation
Dead simple calendar implementation

Package provides a CalendarView which can be used to display simple calendar in your App.

A calendar quick view for the MacOS status bar

Calendar Quick View Quick Menu Calendar in the mac app store An open source macOS calendar preview utility Download from the Mac App Store Visualizati

A custom visual calendar for iOS 8+ written in Swift (>= 4.0).
A custom visual calendar for iOS 8+ written in Swift (= 4.0).

Overview Screenshots GIF Demo Installation Usage Architecture Version matrix Advanced API For contributors Screenshots GIF Demo Installation CocoaPods

An availability calendar implementation for iOS
An availability calendar implementation for iOS

NWCalendarView NWCalendar View is an iOS control that displays a calendar. It is perfect for appointment or availibilty selection. It allows for selec

Releases(1.0.1)
Owner
Seyyed Parsa Neshaei
CE Student at Sharif University of Technology - iOS, Android and Web developer
Seyyed Parsa Neshaei
A declarative, performant, iOS calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-featured calendar apps.

HorizonCalendar A declarative, performant, calendar UI component that supports use cases ranging from simple date pickers all the way up to fully-feat

Airbnb 2.2k Jan 4, 2023
The Unofficial Apple iOS Swift Calendar View. Swift calendar Library. iOS calendar Control. 100% Customizable

Q: How will my calendar dateCells look with this library? A: However you want them to look. More Images Features Range selection - select dates in a r

PatchTheCode 7.3k Jan 2, 2023
SwiftUI Simple Calendar / Date Picker for iOS

RKCalendar RKCalendar is a SwiftUI Calendar / Date Picker for iOS. Features include: minimum and maximum calendar dates selectable, single date select

null 453 Dec 28, 2022
iOS 7+ Calendar (Date Picker) with Infinite Scrolling.

RSDayFlow iOS 7 Calendar with Infinite Scrolling. Only need 4 lines of code to set up. RSDayFlow is a slim fork of DayFlow with updates and extensions

Ruslan Skorb 844 Sep 14, 2022
A fully customizable calendar view acting as a date range picker

Demo Installation CocoaPods With CocoaPods you can simply add GLCalendarView in your Podfile: pod "GLCalendarView", "~> 1.0.0" Source File You can co

Glow Inc 860 Nov 18, 2022
A SwiftUI calendar view that allows month switching and date picking.

Selectable Calendar View A SwiftUI calendar view that allows month switching and date picking. Usage You can simply add this repository to your projec

γ‚·γƒ₯ンジョーゑ 10 Jul 21, 2022
Simple customizable calendar component in Swift :calendar:

Koyomi Koyomi is a simple calendar view framework for iOS, written in Swift ?? Content Features Demo App Usage introduction : Change displayed month,

Shohei Yokoyama 741 Dec 24, 2022
Malendar is a personal calendar app that connects to your default calendar and lets you add/delete events

Malendar is a personal calendar app that connects to your default calendar and lets you add/delete events. It will gather events from your default iOS calendar.

Chase 194 Jan 4, 2023
A Swift UI component for Lunar Calendar Picker

LunarYearDatePicker a Swift UI component for Lunar Calendar Picker Usage: struct

null 6 Nov 22, 2022
An Easy to Use Calendar for iOS (Swift 5.0)

This is an easy to use, "just drag and drop it in your code" type of calendar for iOS. It supports both vertical and horizontal scrolling, as well as

Michael Michailidis 525 Dec 23, 2022