Giter Club home page Giter Club logo

datetimepicker's People

Contributors

abodnyaua avatar amduma avatar bre7 avatar dotwasim avatar frogg avatar hemo87 avatar hoangdinhtho avatar huongvinid avatar itsmeichigo avatar monkeywithacupcake avatar rafaelfrancisco-dev avatar tphduy avatar vitalii-tym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

datetimepicker's Issues

Disable Certain Days/Hours

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?

[Request] Custom data

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.

Get Only view

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)

Hide the date

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.

Start at center when minimum date = current date?

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)

screen shot 2559-11-03 at 1 03 31 pm

but my expected result is like this:

screen shot 2559-11-03 at 1 04 31 pm

Thank you,

Timewheel automatically scrolling to random dates after swipe select.

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
}

Custom handler for cancel button pressed

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

Embed picker in the page

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!

Not able to get time in 24 hour format

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 ?

Select date / time in the past

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!

How can I hide time picker?

I want to show only Date Picker, not Time Picker?
And when Time Picker is Hide, the size of picker would be decreased.?

Select time to be shown only

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

Carthage Integration

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.

Change the background color of the Done button and the textColor of the Cancel Button

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.

Scrolling between minutes returns wrong hour

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

  1. Open the component with a default date time to the current one
  2. Scroll the minutes so that the hour is supposed to go down by 1
  3. Confirm

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

idear for pick the year and day

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:

  1. if the user will just pick a day next several month or pre several month, the calendar view may be the best choice, it just need feel click to pick the date.
  2. if the user need to locate the day quite far away from today, the picker may be better

Unable to simultaneously satisfy constraints

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)>

Cell selection totally broken with Xcode 9

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.

How can one select year?

Is there any option to select year or month manually rather then scrolling till that year/month is there..

Range

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)

UI idea for month and year selection

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
screenshot_20180625-203031_calendar
screenshot_20180625-203025_calendar
screenshot_20180625-203036_calendar

Add TimeZone

Add an API to specify a timezone.

    public var timeZone = TimeZone.current


    internal var components: DateComponents! {
        didSet {
            components.timeZone = timeZone
        }
    }

Minimum Date Selected Bug

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.

Swift 4 support ?

Hi,

Please make this pod support Swift 4 at the moments. Thank you

Default selectedDate:

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.

iOS 8 support

Is there anyway that I can use this library with iOS 8 support ?

Simply doesn't work for me

`
@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

App crashes when closing and opening picker quickly

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).

screen shot 2017-12-10 at 14 57 42

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?

Taking some time to show DateTimePicker.

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()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.