Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: add minute interval to show #107

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DatePickerDialog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "DatePickerDialog"
s.version = "3.0"
s.version = "3.0.1"
s.summary = "Date picker dialog for iOS"
s.homepage = "https://github.com/squimer/DatePickerDialog-iOS-Swift"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down
3 changes: 2 additions & 1 deletion README.mdown
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# DatePickerDialog 3.0- iOS - Swift
# DatePickerDialog 3.0.1- iOS - Swift

DatePickerDialog is an iOS drop-in classe that displays an UIDatePicker within an UIAlertView.

Expand Down Expand Up @@ -83,6 +83,7 @@ DatePickerDialog(locale: Locale(identifier: "es_PY")).show(title: "DatePicker",
- minimumDate: Date
- maximumDate: Date
- datePickerMode: UIDatePickerMode **(Required)**
- minuteInterval: Int
- callback: ((date: Date) -> Void) **(Required)**

## Special thanks to
Expand Down
2 changes: 2 additions & 0 deletions Sources/DatePickerDialog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ open class DatePickerDialog: UIView {
defaultDate: Date = Date(),
minimumDate: Date? = nil, maximumDate: Date? = nil,
datePickerMode: UIDatePicker.Mode = .dateAndTime,
minuteInterval: Int = 1,
callback: @escaping DatePickerCallback
) {
self.titleLabel.text = title
Expand All @@ -104,6 +105,7 @@ open class DatePickerDialog: UIView {
self.datePicker.date = self.defaultDate ?? Date()
self.datePicker.maximumDate = maximumDate
self.datePicker.minimumDate = minimumDate
self.datePicker.minuteInterval = max(1, minuteInterval)
if let locale = self.locale { self.datePicker.locale = locale }

/* Add dialog to main window */
Expand Down