Skip to content

Commit 3e5e338

Browse files
author
Alberto Aznar
committed
Updated with more margin dates
1 parent 64b0fc8 commit 3e5e338

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

DateScrollPicker.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ s.ios.deployment_target = '10.0'
1313
s.name = 'DateScrollPicker'
1414
s.summary = 'Fully customizable date scroll view with picker feature for iOS written in Swift 5'
1515
s.description = 'DateScrollPicker create a view with a UICollectionView. This collection has infinite cells with dates. You can customize all this cells with your own fonts and colors.'
16-
s.version = '1.0.2'
16+
s.version = '1.0.3'
1717

1818
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
1919

DateScrollPicker/Classes/DateScrollPicker.swift

+5-4
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,17 @@ open class DateScrollPicker: UIView {
7373
}
7474

7575
private func setupInitialDays() {
76-
let monthStartDate = Date().firstDateOfMonth()
77-
let monthEndDate = monthStartDate.addMonth(1)!
76+
let monthStartDate = Date().firstDateOfMonth().addMonth(-12)!
77+
let monthEndDate = Date().firstDateOfMonth().addMonth(12)!
7878
var currentDate = monthStartDate
7979

80-
dateItems.append(DateScrollItem(date: currentDate, selected: false, separator: true))
8180
while currentDate < monthEndDate {
81+
if currentDate == currentDate.firstDateOfMonth() {
82+
dateItems.append(DateScrollItem(date: currentDate, selected: false, separator: true))
83+
}
8284
dateItems.append(DateScrollItem(date: currentDate, selected: false, separator: false))
8385
currentDate = currentDate.addDays(1)!
8486
}
85-
dateItems.append(DateScrollItem(date: monthEndDate, selected: false, separator: true))
8687
}
8788

8889
private func setupCollection() {

Example/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PODS:
2-
- DateScrollPicker (1.0.2)
2+
- DateScrollPicker (1.0.3)
33

44
DEPENDENCIES:
55
- DateScrollPicker (from `../`)
@@ -9,7 +9,7 @@ EXTERNAL SOURCES:
99
:path: "../"
1010

1111
SPEC CHECKSUMS:
12-
DateScrollPicker: b77f11f147aa12ed0a90b53ff40e77d0935ff302
12+
DateScrollPicker: 5e7eda14843b92881094f5fda53e355567159342
1313

1414
PODFILE CHECKSUM: c24bf58c0465fe9acaa42046819f831bed4a7f85
1515

Example/Pods/Local Podspecs/DateScrollPicker.podspec.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Manifest.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Example/Pods/Target Support Files/DateScrollPicker/DateScrollPicker-Info.plist

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)