Skip to content

Commit

Permalink
Fixed a bug in date selection
Browse files Browse the repository at this point in the history
  • Loading branch information
ipraba committed Feb 26, 2016
1 parent 1226dd4 commit 9740074
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
Binary file not shown.
6 changes: 4 additions & 2 deletions EPCalendar/EPCalendarPicker/EPCalendarPicker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,11 @@ public class EPCalendarPicker: UICollectionViewController {

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

print(currentDate)

if arrSelectedDates.filter({ $0.isDateSameDay(currentDate)
}).count > 0 {
}).count > 0 && (firstDayOfThisMonth.month() == currentDate.month()) {

cell.selectedForLabelColor(dateSelectionColor)
}
else{
Expand Down Expand Up @@ -231,6 +232,7 @@ public class EPCalendarPicker: UICollectionViewController {
}
}
else {
cell.deSelectedForLabelColor(weekdayTintColor)
cell.isCellSelectable = false
let previousDay = firstDayOfThisMonth.dateByAddingDays(-( prefixDays - indexPath.row))
cell.currentDate = previousDay
Expand Down
12 changes: 6 additions & 6 deletions EPCalendar/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class ViewController: UIViewController, EPCalendarPickerDelegate {
}

@IBAction func onTouchShowMeCalendarButton(sender: AnyObject) {
let calendarPicker = EPCalendarPicker(startYear: 2016, endYear: 2017, multiSelection: false, selectedDates: [])
let calendarPicker = EPCalendarPicker(startYear: 2016, endYear: 2017, multiSelection: true, selectedDates: [])
calendarPicker.calendarDelegate = self
calendarPicker.startDate = NSDate()
calendarPicker.hightlightsToday = false
calendarPicker.showsTodaysButton = false
calendarPicker.hightlightsToday = true
calendarPicker.showsTodaysButton = true
calendarPicker.hideDaysFromOtherMonth = true
calendarPicker.tintColor = UIColor.blackColor()
calendarPicker.barTintColor = UIColor.greenColor()
calendarPicker.tintColor = UIColor.orangeColor()
// calendarPicker.barTintColor = UIColor.greenColor()
calendarPicker.dayDisabledTintColor = UIColor.grayColor()
calendarPicker.title = "Title"
calendarPicker.title = "Date Picker"

// calendarPicker.backgroundImage = UIImage(named: "background_image")
// calendarPicker.backgroundColor = UIColor.blueColor()
Expand Down
4 changes: 2 additions & 2 deletions EPCalendarPicker.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "EPCalendarPicker"
s.version = "1.0.7"
s.version = "1.0.8"
s.summary = "Colourful calendar component for iOS written in Swift"
s.description = <<-DESC
Features
Expand All @@ -13,7 +13,7 @@ DESC
s.homepage = "https://github.com/ipraba/EPCalendarPicker"
s.license = 'MIT'
s.author = { "Prabaharan" => "[email protected]" }
s.source = { :git => "https://github.com/ipraba/EPCalendarPicker.git", :tag => '1.0.7' }
s.source = { :git => "https://github.com/ipraba/EPCalendarPicker.git", :tag => '1.0.8' }
s.platform = :ios, '8.0'
s.requires_arc = true
s.source_files = 'EPCalendar/EPCalendarPicker'
Expand Down
Binary file removed Screenshots/Walkthough.gif
Binary file not shown.
Binary file added Screenshots/Walkthrough1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 9740074

Please sign in to comment.