All Projects → joshbirnholz → Jbcalendardatepicker

joshbirnholz / Jbcalendardatepicker

Licence: mit
A replacement for UIDatePicker made for Catalyst.

Programming Languages

swift
15916 projects

Labels

Projects that are alternatives of or similar to Jbcalendardatepicker

Flexiblecalendar
A flexible android calendar
Stars: ✭ 174 (-14.29%)
Mutual labels:  calendar
Recal
A minimal, accessible React/Preact calendar component using modern CSS.
Stars: ✭ 191 (-5.91%)
Mutual labels:  calendar
Vue Mobile Calendar
a vue component of calendar for mobile移动端vue日期选择组件
Stars: ✭ 194 (-4.43%)
Mutual labels:  calendar
Vacalendar
Custom Calendar for iOS in Swift
Stars: ✭ 184 (-9.36%)
Mutual labels:  calendar
Eventscalendar
Events Calendar is a user-friendly library that helps you achieve a cool Calendar UI with events mapping. You can customise every pixel of the calendar as per your wish and still achieve in implementing all the functionalities of the native android calendar in addition with adding dots to the calendar which represents the presence of an event on the respective dates. It can be done easily, you are just a few steps away from implementing your own badass looking Calendar for your very own project!
Stars: ✭ 188 (-7.39%)
Mutual labels:  calendar
React Datepicker2
react datepicker component.(include persian jalaali calendar)
Stars: ✭ 191 (-5.91%)
Mutual labels:  calendar
Lunar Java
无第三方依赖的公历(阳历)和农历(阴历、老黄历)工具,支持节假日、星座、儒略日、干支、生肖、节气、节日、彭祖百忌、每日宜忌、吉神宜趋凶煞宜忌、吉神(喜神/福神/财神/阳贵神/阴贵神)方位、胎神方位、冲煞、纳音、星宿、八字、五行、十神、建除十二值星、青龙名堂等十二神、黄道黑道日及吉凶等。lunar is a calendar library for Solar and Chinese Lunar.
Stars: ✭ 166 (-18.23%)
Mutual labels:  calendar
Hotel Datepicker
Date range picker for hotels
Stars: ✭ 202 (-0.49%)
Mutual labels:  calendar
Angular Calendar
A calendar component for Angular 12.0+ that can display events on a month, week or day view. The successor of angular-bootstrap-calendar.
Stars: ✭ 2,312 (+1038.92%)
Mutual labels:  calendar
Icalendar Generator
Generate calendars in the iCalendar format
Stars: ✭ 193 (-4.93%)
Mutual labels:  calendar
Android Week Calendar
android可自定义日历方案,支持农历、自定义日历控件、排班、左右滑动、周月切换、跳转到指定日期等功能
Stars: ✭ 186 (-8.37%)
Mutual labels:  calendar
Kin Api Server
API Server for Kin Calendar
Stars: ✭ 188 (-7.39%)
Mutual labels:  calendar
Add Event To Calendar Docs
📅 Docs how to generate links to add events to online calendar services
Stars: ✭ 193 (-4.93%)
Mutual labels:  calendar
Date
A date and time library based on the C++11/14/17 <chrono> header
Stars: ✭ 2,389 (+1076.85%)
Mutual labels:  calendar
Mxlcalendarmanager
A set of classes used to parse and handle iCalendar (.ICS) files
Stars: ✭ 198 (-2.46%)
Mutual labels:  calendar
Calendar Heatmap
📊 Calendar heatmap graph
Stars: ✭ 170 (-16.26%)
Mutual labels:  calendar
Poetry Calendar
✨🗓✨一个美炸天的诗词周历 , 52个周给你新的体验。
Stars: ✭ 192 (-5.42%)
Mutual labels:  calendar
Rdvcalendarview
Highly customizable calendarView and calendarViewController for iOS
Stars: ✭ 203 (+0%)
Mutual labels:  calendar
Ember Power Calendar
Powerful and customizable calendar component for Ember
Stars: ✭ 200 (-1.48%)
Mutual labels:  calendar
Yii2 Tech
Yii2 通用后台管理系统
Stars: ✭ 193 (-4.93%)
Mutual labels:  calendar

JBCalendarDatePicker

A replacement for UIDatePicker made for Catalyst.

This is still a work in progress, there are bugs, and although it's written to work with different calendar systems and locales, it's not guaranteed to work correctly with everything!

JBCalendarDatePicker

Installation

To install as SPM, Go to: Xcode -> File -> Swift Packages -> Add Package Dependency

Then enter this URL: https://github.com/mohitnandwani/JBCalendarDatePicker.git

To install, add the source to the top of your podfile:

source 'https://github.com/joshbirnholz/JBPodSpecs.git'

Then add this pod to your targets:

pod 'JBCalendarDatePicker'

Use

There are two classes you can use: JBDatePickerViewController and JBCalendarViewController.

They are both similar to UIDatePicker, and their date, minimumDate, maximumDate, calendar, and locale properties can be configured in the same way. Configure them before presenting either of the view controllers.

JBDatePickerViewController also has a datePickerMode property, although UIDatePicker.Mode.countDownTimer is not supported.

JBDatePickerViewController

JBDatePickerViewController

JBDatePickerViewController displays labels showing its represented date and allows the user to use the keyboard to enter a date. When the user clicks on the date portion, the view controller presents its own JBCalendarViewController. You can allow the user to select a date, time, or both, by setting the datePickerMode property.

import JBCalendarDatePicker

class ViewController: UIViewController {

	var datePicker: JBDatePickerViewController!
	
	override func viewDidLoad() {
		super.viewDidLoad()
		
		let datePicker = JBDatePickerViewController()
		view.addSubview(datePicker.view)
		addChild(datePicker)
		datePicker.didMove(toParent: self)
		self.datePicker = datePicker

		// Configure the datePicker's properties
	}
}

Or use it from a storyboard. Drag a Container View onto your storyboard. Change the view controller's class to JBDatePickerViewController. Give the embed segue an identifier, and then capture a reference to it:

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
	if segue.identifier == "Embed Date Picker", let destination = segue.destination as? JBDatePickerViewController {
		self.datePicker = destination
		
		// Configure the datePicker's properties
	}
}

JBCalendarViewController

JBCalendarViewController

JBCalendarViewController is just the calendar, without the labels.

The view controller tries to present itself as a popover automatically, so be sure to set the popoverPresentationController's barButtonItem property or the sourceView and sourceRect properties.

@IBOutlet func buttonPressed(_ sender: UIBarButtonItem) {
	let calendarPicker = JBCalendarViewController()
	calendarPicker.popoverPresentationController?.barButtonItem = sender
	
	// Configure the calendar's properties
	
	present(calendarPicker, animated: true, completion: nil)
}

There is also a JBCalendarViewControllerDelegate protocol.

public protocol JBCalendarViewControllerDelegate: class {
	func calendarViewControllerDateChanged(_ calendarViewController: JBCalendarViewController)
	func calendarViewControllerWillDismiss(_ calendarViewController: JBCalendarViewController)
	func calendarViewControllerDidDismiss(_ calendarViewController: JBCalendarViewController)
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].