itsmeichigo / datetimepicker Goto Github PK
View Code? Open in Web Editor NEWA nicer iOS UI component for picking date and time
License: MIT License
A nicer iOS UI component for picking date and time
License: MIT License
Hello ,
I was wondering if there is a function in this library that allows us to disable certain days and hours?
For example in the time picker 12:30 would be disabled but not hidden. Or in a different colour?
I want to change the date format that appears on the top of the picker.
How can we change to the AM and PM
Hi, I want to know if its possible to add an option to use custom data apart from dates like an array of names, it would be awesome, thanks.
hello, i'm noob in swift and iOS developing
i want replace keyboard to date picker view(like: textfield.inputView = picker) when clicked button. but it's not working. picker cover textfield.
how to resolved this problem?!)
p.s ๐ good library. my isn't perfect)
The doneBackgroundColor is not working. No matter what I set the color to it keeps the darkColor with a 50% alpha.
It sometimes work but mostly does not work. Is there any fix for this ?
Hi,
Thanks for your repo.
I wanna to use it but I need to hide date because I just need a picker for time. isDatePickerOnly
is used to hide the time, is there a way to hide the date and just show the time ?
Thanks.
Hi first of all , Thank you for this cool date picker !!
Is there's an easy way to handle this situation where I have current date as minimum.
ex:
let min = current
let max = Date().addingTimeInterval(60 * 60 * 24 * 365)
let picker = DateTimePicker.show(selected: self.current, minimumDate: min, maximumDate: max)
but my expected result is like this:
Thank you,
I am having a strange issue with DateTimePicker. When swiping the time wheel it automatically scrolls to some seemingly random date. Only happens on iOS 11, built with Xcode 9. On tapping times, it works correctly, only swiping breaks it.
Using: DateTimePicker (1.1.2) through Cocoapods, Swift 3
This is my code;
let date = self.defaultDate()
let minDate = Date().addingTimeInterval(24*60*60)
let picker = DateTimePicker.show(selected: date, minimumDate: minDate, maximumDate: nil)
picker.highlightColor = Color.pink.base
picker.tintColor = Color.pink.base
picker.doneButtonTitle = "Set date"
picker.completionHandler = { date in
let dateString = DateHelper.shared.isoDateString(date: date)
self.currentDate = dateString
}
Hi, I would like to know when is the user press the cancel button, but it looks like to be fixed to only dismiss view when the cancel button pressed.
Is there any way to detect this event?
Thanks!
Yu-Hsiang
Please add an option to have custom time intervals say every 10 minutes for the time picker. Could nto figure out a good way to do this in the code myself unfortunately.
Hi,
Thanks for your work! Could you help me to figure out how to embed that picker inside the page? So it doesn't pop up on a button press but is always shown on the page.
Thanks!
how to set minimum date and time. I want to disable date and time less than minimum date
i found , you said i can make it time only , but i dont find property for that option
I gave picker.is12HourFormat = true to get time in 24 hour format
but am not able to get it in 24 hour format
func dateTimePicker(_ picker: DateTimePicker, didSelectDate: Date){
print(picker.selectedDateString). // 08:53 PM 2018-04-02
instead of 08: 53 PM I need output as 20:53
}
Could any one help me regarding this ?
Hey,
how can I configure the picker so I can choose a time in the past? I've set the isTimePickerOnly value to "true" and tried to set the selected date in the future and to test it also in the past but when I want to set a time in the past it always scrolls back to the current time. Could you help me please?
Thanks in advance!
I want to show only Date Picker, not Time Picker?
And when Time Picker is Hide, the size of picker would be decreased.?
is it possible to show only the selected time in the Time interval?
like what i need is as follows
8:00 AM
8:30 AM
9:00 AM
9:30 AM
.
.
.
12:00 PM
I would like to be able to integrate DateTimePicker to my project via Carthage instead of Cocoa Pods, sadly right now this is not possible: Dependency "DateTimePicker" has no shared framework schemes
I'm not experienced enough to know if this is a complex task, but maybe you can look into this.
can't programmatically dismiss the view
Is it possible to remove the dark shadow in the background. I know i can change the color but that does not help
Changing the darkColor property does not change the Done button's background or the Cancel button's textColor. I am not sure if this was intentional or not.
I was able to fix this by adding a didSet to the darkColor's declaration in the DateTimePicker class like you did in the highlightColor's declaration.
If this is not the desired behavior you were intending then it would be very helpful if you would create a way for us to change these controls' visual properties.
Hi guys!
UIApplication.shared.keyWindow?.addSubview(dateTimePicker)
How to show datetimepicker in UIview in viewdidload? Thanks!
Is there a way to select from a 12 hr time picker instead of 24?
hello. Thanks you for great library.
I think it would be better when implment blur effect or dim screen effect when show dialog
Issue
When selecting a time and scroll the minutes below 00, minutes reset to 59 (good) the hours don't change (error) but accepting returns wrong hour by doing this.
Reproduce
Expected behaviour
OR the component should also change the hour in the dialog
OR it should not return another value than displayed in the dialog
Add a calendar icon on the left of the label "Today". when press the icon button, the day's collectionView can be covered by a calendar collectionView, then you can scroll the collection view to picker the day you want.
Considering the needs for different application:
An error is shown when running the example:
[LayoutConstraints] Unable to simultaneously satisfy constraints.
Probably at least one of the constraints in the following list is one you don't want.
Try this:
(1) look at each constraint and try to figure out which you don't expect;
(2) find the code that added the unwanted constraint or constraints and fix it.
(
"<_UILayoutSupportConstraint:0x6100000960d0 _UILayoutGuide:0x7fa16b406020.height == 0 (active)>",
"<_UILayoutSupportConstraint:0x610000092700 V:|-(0)-[_UILayoutGuide:0x7fa16b406020] (active, names: '|':UIView:0x7fa16b60e4d0 )>",
"<NSLayoutConstraint:0x610000095c20 V:[_UILayoutGuide:0x7fa16b406020]-(-20)-[UINavigationBar:0x7fa16b607d40] (active)>",
"<NSLayoutConstraint:0x610000095c70 V:|-(0)-[UINavigationBar:0x7fa16b607d40] (active, names: '|':UIView:0x7fa16b60e4d0 )>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x610000095c20 V:[_UILayoutGuide:0x7fa16b406020]-(-20)-[UINavigationBar:0x7fa16b607d40] (active)>
Something related to ScrollView must have changed in Xcode 9 and now selected hour or minute always gets shifted. I did a quick investigation but couldn't really figure out what's going on. Could someone please take a look? This awesome library won't be any use if we can't fix the issue. Thanks.
Is there any option to select year or month manually rather then scrolling till that year/month is there..
How can I activate or deactivate time picker range? It is not allowing me to pick the time from past which i need to. (eg: Its 5:30 pm I need to pick 4:30 pm, which i cant)
If I set minimumDate to now, the picker still allows user to pick earlier time today.
It should restrict user to only pick time after now.
We can have a switch or a selection kind of a thing on the left hand side on the current date view. Where the user can select the view he/she wants something like the Samsung calendar(Attaching screenshots for the same). The date / month / year selection will become extremely easy and the UX is gonna be brilliant.
Let me know if this works for you. I really love you library though
Add an API to specify a timezone.
public var timeZone = TimeZone.current
internal var components: DateComponents! {
didSet {
components.timeZone = timeZone
}
}
To recreate: Open the DateTimePicker control and select the minimum date, press the done button, re-open the control. I have been getting a crash in the show method (line: 220) of the DateTimePicker controller.
I have been getting intermittent results, sometimes it works with the minimum but will crash on the maximum. It will almost always crash on one or the other.
Hi,
Please make this pod support Swift 4 at the moments. Thank you
There's no way to dismiss the picker. I think there should be a cancel button to dismiss the picker without selecting a date.
picker.selectedDate
Does change the title Date that appears on the top of picker. But doesn't the change actual date that is on centre of collectionView
.
Please let me know fix ASAP.
Is there anyway that I can use this library with iOS 8 support ?
`
@IBAction func endDatePressed(_ sender: Any) {
let min = Date()
let max = Date().addingTimeInterval(60 * 60 * 24 * 4)
let picker = DateTimePicker.show(minimumDate: min, maximumDate: max)
picker.highlightColor = UIColor(red: 255.0/255.0, green: 138.0/255.0, blue: 138.0/255.0, alpha: 1)
picker.darkColor = UIColor.darkGray
picker.doneButtonTitle = "Done"
picker.todayButtonTitle = "Today"
picker.is12HourFormat = true
picker.dateFormat = "hh:mm aa dd/MM/YYYY"
// picker.isDatePickerOnly = true
picker.completionHandler = { date in
let formatter = DateFormatter()
formatter.dateFormat = "hh:mm aa dd/MM/YYYY"
self.endField.text = formatter.string(from: date)
}
}
`
Here's a video
http://tinypic.com/player.php?v=6itsvq%3E&s=9#.Waz0OtsUW_I
Is it possible already to easily just select 15 minutes as selectable options in minutes table?
if not.. suggestions to easily implement that feature ( I could have some spare time to tackle that) ?
Other than that, this pod is absolutely unreal. Thanks a bunch!
So the issue is that when you have opened the picker and close it, then quickly after opening it again (in my case by tapping UITextField), the picker crashes (see screenshot).
My setup for creating the picker:
let picker = DateTimePicker.show(selected: Date(), minimumDate: Date(), maximumDate: nil)
picker.highlightColor = CawColor.buttonAction
picker.isDatePickerOnly = false
picker.includeMonth = true
picker.todayButtonTitle = "Nu"
picker.doneButtonTitle = "Kies"
picker.cancelButtonTitle = "Annuleren"
picker.completionHandler = { date in
// do something after tapping done
}
Note that is not needed to close and open the picker quickly. I think this is due to the show() method that gets 2 Date() objects?
I can change interval minutes to 30 minutes as selectable options in minutes table?
If I have following initializer. It takes some time to present.
DateTimePicker.show(selected: Date.init(), minimumDate: nil, maximumDate: nil)
And If I have following Initializer. Picker present immediately.
DateTimePicker.show()
how to select minimum & maximum date time
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.