GithubHelp home page GithubHelp logo

epcalendarpicker's People

Contributors

ipraba avatar thachphat avatar urkman 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

epcalendarpicker's Issues

[!!!] iPhone 8 Plus layout issue

on iphone 8 plus the calendar has 8 days per row which messes up the whole format
(the grayed out should be weekends and theyre not in the right spots)
image

How do I fix this?

Disable date selected

set multiple selection to false then in single selection past date is also selectable.

modify selected dates array

Hi, the issues is, while I am creating calendar controller and providing an array with already selected dates. Than I need to remove some dates from this array and save again calendar with new array of dates. But you not removing no needed dates from current array and adding another the same 2 dates and not modifying current array

this is array from delegate
I have provided these dates 2016-04-10 21:00:00 +0000, 2016-04-12 21:00:00 +0000 than clicked again to remove it and get this one
[2016-04-10 21:00:00 +0000, 2016-04-12 21:00:00 +0000, 2016-04-10 21:00:00 +0000, 2016-04-12 21:00:00 +0000]

Still facing the issue of the repeating current day...

I had it in my last version, but now when updated it to the latest version (1.0.5) i'm still facing the same issue. the current day 15-2 is repeating in all the months (15-3,15-4...) any solution would be appreciated.

month to open selected date

when i open calendar it show current month & date .. After i select next 2 month date & when i again open calendar it open with new month instead of current month....

Swift 4 Issue

Currently it's not working on Swift 4.0. It builds but whenever i try to choose date it crashes with the error below:

*** /Users/x/Desktop/x/x/x/EPCalendarPicker/EPCalendarPicker.swift:254:5: implicit Objective-C entrypoint -[x.EPCalendarPicker collectionView:layout:sizeForItemAtIndexPath:] is deprecated and will be removed in Swift 4; add explicit '@objc' to the declaration to emit the Objective-C entrypoint in Swift 4 and suppress this message 2017-09-14 09:26:27.702076+0300 x[1885:288332] *** /Users/x/Desktop/x/x/x/EPCalendarPicker/EPCalendarPicker.swift:254:5: implicit Objective-C entrypoint -[x.EPCalendarPicker collectionView:layout:sizeForItemAtIndexPath:] is deprecated and will be removed in Swift 4; add explicit '@objc' to the declaration to emit the Objective-C entrypoint in Swift 4 and suppress this message

Incorrect day in month header

Great component ;) I just wanted to report a bug related to day names when weeks start on Monday instead of Sunday.
Even if the labels are updated manually inside the header (EPCalendarHeaderView), updateWeekendLabelColor will still color the first and last instead of the last two.

There are several ways to fix this:

  • Create a new EPCalendarHeaderView (too much work imo...Unless you reuse the nib)
  • Change updateWeekendLabelColor and updateWeekdaysLabelColor to take NSCalendar.currentCalendar().firstWeekday into account. And also change the label values.

Eg:

screen shot 2016-02-08 at 20 45 35 screen shot 2016-02-08 at 20 46 11

**


Feb 1st was Monday

**

Landscape

Does weird things when starting in landscape and then rotate to portrait and back and forth

Again it has to be presented in landscape initially to start

Swift 3 update?

are you planning to update pod so it can support Swift 3 syntax?

Is there any way to show only few weeks?

Say I want to shown only first and second week of a month, which might be reflected as - 2 or 3 rows in month view calendar, is there any way to achieve this using this library?

How we can disable a particular date from the Calendar

Hi,
Here i am not able to understand, how can i disable any particular date from the calendar view.
Let's suppose today date is 18th June 2016, before 18th June 2016 all dates is disable but i want disable
next to 18th June 2016, example i want to disable 24th June 2016
How should i do that please tell me as soon as possible
Thanks in advance

Swift 3.0 Issues

Just did an update to Swift 3.0 and noticing a few build-time errors:

screen shot 2016-09-15 at 15 02 37

and:

screen shot 2016-09-15 at 15 03 13

Values selected correspond to one day earlier

When I select a few dates (e.g. 19, 20, 21 June 2016) and then click "done" the actual dates in arrSelectedDates are one day earlier (i.e. 18, 19, 20 June 2016). See screen shots below. (Problem is the same if I select a single date or multiple dates).

It is very strange. The value of cell.lblDay.text is correctly set to 19 (if for example I select 19 June 2016) but cell.currentDate is set to value 18 June 2016.

override public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {

[...]

cell.currentDate = currentDate
cell.lblDay.text = "\(currentDate.day())"

I tried to modify cell.currentDate = currentDate by adding one day to it cell.currentDate = currentDate.dateByAddingDays(1). The return values in arrSelectedDates are then correct. But when I scroll out and scroll back in the wrong dates are highlighted.

Could this have something to do with different time zones or is it a completely different problem?
Any idea what could be the issue? I am running iOS 9.3.2 and Xcode 7.3.1. The issue happens on my iPhone as well as different simulators.

screen shot 2016-06-18 at 02 02 41
screen shot 2016-06-18 at 02 02 58

Open Calendar in Container View ?

First of all, let me start by saying, this is by far the best comfortable calendar i've touched ๐Ÿ‘ .
i'm trying to load the calendar inside a view, or a container view since i want it to fill my empty screen (I do not want a button to load the calendar), is it possible ?

Crash with swift 3.0

app crash on numberOfItemsInSection method of EPCalendarPicker class in swift 3.0.
crash logs reason: 'the collection view's data source did not return a valid cell from -collectionView:cellForItemAtIndexPath: for index path <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0}'

Overriding Language

Hi,

When using EPCalendarPicker on a device with a Locale different than US English, the calendar shows in Spanish. This causes a different number of problems because of the way my app communicates with the backend. Is there a way to override the device's locale to show the calendar in English regardless?

Thanks.

Bridging Header issue

Hi,

I tried your Swift files in my Objective _ c project using Obj-c Header .
i am not able to calendar but the view is presenting.
When i debug that collection view delegate and dataSource methods are not calling.

Please Help me out.

Thanks in Advance.

Multi Colors Date

Hello,

Is this possible to show different dates in different colours viz. 1 in Red 2 in Green and 3 in Yellow and so On. It means Is it possible that I can pass different dates to set different colours ?

Thanks

Printing the dates from start year to current date in console automatically

When selecting an disabled date from the calendar, the dates from the start date of the calendar to current date is printing to the console automatically. How can I disable this ?

I created calander controller instance like this
let calendarPicker = EPCalendarPicker(startYear: 2016, endYear: 2017 multiSelection: false)

and from the calander I selected a disabled date(date before startdate) and this result is automatically printed to console.

2016-02-20 18:30:00 +0000
2016-02-21 18:30:00 +0000
2016-02-22 18:30:00 +0000
2016-02-23 18:30:00 +0000
2016-02-24 18:30:00 +0000
2016-02-25 18:30:00 +0000
2016-02-26 18:30:00 +0000
2016-02-27 18:30:00 +0000
2016-02-28 18:30:00 +0000
2016-02-29 18:30:00 +0000
2016-03-01 18:30:00 +0000
2016-03-02 18:30:00 +0000
2016-03-03 18:30:00 +0000
2016-03-04 18:30:00 +0000
2016-02-29 18:30:00 +0000
2016-03-01 18:30:00 +0000
2016-03-02 18:30:00 +0000
2016-03-03 18:30:00 +0000
2016-03-04 18:30:00 +0000
2016-03-05 18:30:00 +0000
2016-03-06 18:30:00 +0000
2016-03-07 18:30:00 +0000
2016-03-08 18:30:00 +0000
2016-03-09 18:30:00 +0000
2016-03-10 18:30:00 +0000
2016-03-11 18:30:00 +0000
2016-03-12 18:30:00 +0000
2016-03-13 18:30:00 +0000
2016-03-14 18:30:00 +0000
2016-03-15 18:30:00 +0000
2016-03-16 18:30:00 +0000
2016-03-17 18:30:00 +0000
2016-03-18 18:30:00 +0000
2016-03-19 18:30:00 +0000
2016-03-20 18:30:00 +0000
2016-03-21 18:30:00 +0000
2016-03-22 18:30:00 +0000
2016-03-23 18:30:00 +0000
2016-03-24 18:30:00 +0000
2016-03-25 18:30:00 +0000
2016-03-26 18:30:00 +0000
2016-03-27 18:30:00 +0000
2016-03-28 18:30:00 +0000
2016-03-29 18:30:00 +0000
2016-03-30 18:30:00 +0000
2016-03-31 18:30:00 +0000
2016-04-01 18:30:00 +0000
2016-03-31 18:30:00 +0000
2016-04-01 18:30:00 +0000
2016-04-02 18:30:00 +0000
2016-04-03 18:30:00 +0000
2016-04-04 18:30:00 +0000
2016-04-05 18:30:00 +0000
2016-04-06 18:30:00 +0000
2016-04-07 18:30:00 +0000
2016-04-08 18:30:00 +0000
2016-04-09 18:30:00 +0000
2016-04-10 18:30:00 +0000
2016-04-11 18:30:00 +0000
2016-04-12 18:30:00 +0000
2016-04-13 18:30:00 +0000
2016-04-14 18:30:00 +0000
2016-04-15 18:30:00 +0000
2016-04-16 18:30:00 +0000
2016-04-17 18:30:00 +0000
2016-04-18 18:30:00 +0000
2016-04-19 18:30:00 +0000
2016-04-20 18:30:00 +0000
2016-04-21 18:30:00 +0000
2016-04-22 18:30:00 +0000
2016-04-23 18:30:00 +0000
2016-04-24 18:30:00 +0000
2016-04-25 18:30:00 +0000
2016-04-26 18:30:00 +0000
2016-04-27 18:30:00 +0000
2016-04-28 18:30:00 +0000
2016-04-29 18:30:00 +0000
2016-04-30 18:30:00 +0000
2016-05-01 18:30:00 +0000
2016-05-02 18:30:00 +0000
2016-05-03 18:30:00 +0000
2016-05-04 18:30:00 +0000
2016-05-05 18:30:00 +0000
2016-05-06 18:30:00 +0000
2016-05-07 18:30:00 +0000
2016-05-08 18:30:00 +0000
2016-05-09 18:30:00 +0000
2016-05-10 18:30:00 +0000
2016-05-11 18:30:00 +0000
2016-05-12 18:30:00 +0000
2016-05-13 18:30:00 +0000
2016-05-14 18:30:00 +0000
2016-05-15 18:30:00 +0000
2016-05-16 18:30:00 +0000
2016-05-17 18:30:00 +0000
2016-05-18 18:30:00 +0000
2016-05-19 18:30:00 +0000
2016-05-20 18:30:00 +0000
2016-05-21 18:30:00 +0000
2016-05-22 18:30:00 +0000
2016-05-23 18:30:00 +0000
2016-05-24 18:30:00 +0000
2016-05-25 18:30:00 +0000
2016-05-26 18:30:00 +0000
2016-05-27 18:30:00 +0000
2016-03-12 18:30:00 +0000
2016-03-13 18:30:00 +0000
2016-03-14 18:30:00 +0000
2016-03-15 18:30:00 +0000
2016-03-16 18:30:00 +0000
2016-03-17 18:30:00 +0000
2016-03-18 18:30:00 +0000
2016-03-05 18:30:00 +0000
2016-03-06 18:30:00 +0000
2016-03-07 18:30:00 +0000
2016-03-08 18:30:00 +0000
2016-03-09 18:30:00 +0000
2016-03-10 18:30:00 +0000
2016-03-11 18:30:00 +0000
2016-02-29 18:30:00 +0000
2016-03-01 18:30:00 +0000
2016-03-02 18:30:00 +0000
2016-03-03 18:30:00 +0000
2016-03-04 18:30:00 +0000
2016-02-27 18:30:00 +0000
2016-02-28 18:30:00 +0000
2016-02-29 18:30:00 +0000
2016-03-01 18:30:00 +0000
2016-03-02 18:30:00 +0000
2016-03-03 18:30:00 +0000
2016-03-04 18:30:00 +0000
2016-02-20 18:30:00 +0000
2016-02-21 18:30:00 +0000
2016-02-22 18:30:00 +0000
2016-02-23 18:30:00 +0000
2016-02-24 18:30:00 +0000
2016-02-25 18:30:00 +0000
2016-02-26 18:30:00 +0000
2016-02-13 18:30:00 +0000
2016-02-14 18:30:00 +0000
2016-02-15 18:30:00 +0000
2016-02-16 18:30:00 +0000
2016-02-17 18:30:00 +0000
2016-02-18 18:30:00 +0000
2016-02-19 18:30:00 +0000
2016-02-06 18:30:00 +0000
2016-02-07 18:30:00 +0000
2016-02-08 18:30:00 +0000
2016-02-09 18:30:00 +0000
2016-02-10 18:30:00 +0000
2016-02-11 18:30:00 +0000
2016-02-12 18:30:00 +0000
2016-01-31 18:30:00 +0000
2016-02-01 18:30:00 +0000
2016-02-02 18:30:00 +0000
2016-02-03 18:30:00 +0000
2016-02-04 18:30:00 +0000
2016-02-05 18:30:00 +0000
2016-01-30 18:30:00 +0000
2016-01-31 18:30:00 +0000
2016-02-01 18:30:00 +0000
2016-02-02 18:30:00 +0000
2016-02-03 18:30:00 +0000
2016-02-04 18:30:00 +0000
2016-02-05 18:30:00 +0000
2016-01-23 18:30:00 +0000
2016-01-24 18:30:00 +0000
2016-01-25 18:30:00 +0000
2016-01-26 18:30:00 +0000
2016-01-27 18:30:00 +0000
2016-01-28 18:30:00 +0000
2016-01-29 18:30:00 +0000
2016-01-16 18:30:00 +0000
2016-01-17 18:30:00 +0000
2016-01-18 18:30:00 +0000
2016-01-19 18:30:00 +0000
2016-01-20 18:30:00 +0000
2016-01-21 18:30:00 +0000
2016-01-22 18:30:00 +0000
2016-01-09 18:30:00 +0000
2016-01-10 18:30:00 +0000
2016-01-11 18:30:00 +0000
2016-01-12 18:30:00 +0000
2016-01-13 18:30:00 +0000
2016-01-14 18:30:00 +0000
2016-01-15 18:30:00 +0000
2016-03-12 18:30:00 +0000
2016-03-13 18:30:00 +0000
2016-03-14 18:30:00 +0000
2016-03-15 18:30:00 +0000
2016-03-16 18:30:00 +0000
2016-03-17 18:30:00 +0000
2016-03-18 18:30:00 +0000
2016-03-19 18:30:00 +0000
2016-03-20 18:30:00 +0000
2016-03-21 18:30:00 +0000
2016-03-22 18:30:00 +0000
2016-03-23 18:30:00 +0000
2016-03-24 18:30:00 +0000
2016-03-25 18:30:00 +0000
2016-03-26 18:30:00 +0000
2016-03-27 18:30:00 +0000
2016-03-28 18:30:00 +0000
2016-03-29 18:30:00 +0000
2016-03-30 18:30:00 +0000
2016-03-31 18:30:00 +0000
2016-04-01 18:30:00 +0000
2016-03-31 18:30:00 +0000
2016-04-01 18:30:00 +0000
2016-04-02 18:30:00 +0000
2016-04-03 18:30:00 +0000
2016-04-04 18:30:00 +0000
2016-04-05 18:30:00 +0000
2016-04-06 18:30:00 +0000
2016-04-07 18:30:00 +0000
2016-04-08 18:30:00 +0000
2016-04-09 18:30:00 +0000
2016-04-10 18:30:00 +0000
2016-04-11 18:30:00 +0000
2016-04-12 18:30:00 +0000
2016-04-13 18:30:00 +0000
2016-04-14 18:30:

Could Not load NIB in Bundle

let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EPCalendarCell1", for: indexPath) as! EPCalendarCell1

Calendar does not snap to the right position

When I open a CalendarView, the map does not automatically snap to a position that displays the month title.
screen shot 2018-02-12 at 1 21 28 pm

In the attached screenshot, I would expect to be able to see "February 2018" at the top.

multiSelectEnabled = false doesn't work

Hi @ipraba,

Thanks for this amazing piece of happiness, but I have a problem in disabling multiselection. In my scenario, I need to highlight some days, only, some days. That's it. No more no less. The following code doesn't disable multiselection. The user still able to select dates.

OBS: I am displaying your Calendar inside my calendar.

import Foundation
import EPCalendarPicker

class CalendarViewController: UIViewController, EPCalendarPickerDelegate {

    var dates:[Date] = [] //some dates
    var calendarPicker: EPCalendarPicker!

    @IBOutlet weak var cont: UIView!


    override func viewDidLoad() {
        super.viewDidLoad()
        calendarPicker = EPCalendarPicker(startYear: 2016, endYear: 2016, multiSelection: false, selectedDates: dates)
        calendarPicker.calendarDelegate = self
        //calendarPicker.startDate = Date()
        calendarPicker.hightlightsToday = true
        calendarPicker.hideDaysFromOtherMonth = false
        //calendarPicker.tintColor = UIColor.orange
        //calendarPicker.dayDisabledTintColor = UIColor.gray
        //calendarPicker.dateSelectionColor = UIColor.blue
        calendarPicker.multiSelectEnabled = false
        calendarPicker.collectionView?.allowsMultipleSelection = false
        addViewControllerAsChildViewController(viewController: calendarPicker)

    }


![simulator screen shot 15 oct 2016 14 22 49](https://cloud.githubusercontent.com/assets/1541244/19410384/e5d3539a-92e2-11e6-9dfb-fc5ecca81173.png)

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


    func epCalendarPicker(_: EPCalendarPicker, didCancel error : NSError) {
        //txtViewDetail.text = "User cancelled selection"

    }
    func epCalendarPicker(_: EPCalendarPicker, didSelectDate date : NSDate) {
        print(date)
    }
//    func epCalendarPicker(_: EPCalendarPicker, didSelectMultipleDate dates : [NSDate]) {
//        //txtViewDetail.text = "User selected dates: \n\(dates)"
//        print("User selected dates: \n\(dates)")
//    }


    private func addViewControllerAsChildViewController(viewController: UIViewController) {
        // Add Child View Controller
        addChildViewController(viewController)

        // Add Child View as Subview
        view.addSubview(viewController.view)

        // Configure Child View
        viewController.view.frame = view.bounds
        viewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]

        // Notify Child View Controller
        viewController.didMove(toParentViewController: self)
    }
}

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.