ipraba / epcalendarpicker Goto Github PK
View Code? Open in Web Editor NEWColourful calendar for iOS written in Swift
License: MIT License
Colourful calendar for iOS written in Swift
License: MIT License
set multiple selection to false then in single selection past date is also selectable.
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]
It does not delete the days in the current month from next month
Sorry its works
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.
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....
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
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:
updateWeekendLabelColor
and updateWeekdaysLabelColor
to take NSCalendar.currentCalendar().firstWeekday
into account. And also change the label values.Eg:
**
Feb 1st was Monday
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
are you planning to update pod so it can support Swift 3 syntax?
I add it in view with addsubview and return this error "UICollectionView dataSource is not set"
How can I fixed it?
In the attached screenshot (iPhone 8 Plus), you see that the Weekend days (in green) are diagonal, and are not displayed in the correct column. Today is Monday, February 12th, however in the attached screenshot, the 12th is in the Saturday column.
This issue is not seen on an iPhone X.
The app crash when I use scrollToToday
Is it possible to set a range for date to be select, like user can only select a date from today to next 15 day.
Dear ipraba,
How to initialize EPCalendarPicker with selected dates?
Users always want to re-pick the dates after they choose.
How to achieve it?
Regards,
Raptor
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?
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
Is it possible to enable for select only specific dates?
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.
Hello. How to change first day of week from Sunday to Monday?
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 ?
Ist there a property to set the minimum date to be selected?
So disable dates before this date?
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}'
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.
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.
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
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:
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "EPCalendarCell1", for: indexPath) as! EPCalendarCell1
Is there any out of box way to support horizontal scrolling in place of vertical scrolling?
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)
}
}
Is there a property to set Monday as the start of the week?
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.