Skip to content

Commit

Permalink
20220117_4
Browse files Browse the repository at this point in the history
  • Loading branch information
qubyedev committed Jan 16, 2022
1 parent 5c2c311 commit fe6acfb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Sources/CalendarStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public struct TimelineStyle {
public var verticalDiff: CGFloat = 150//50 0115 by Yuan
public var verticalInset: CGFloat = 10
public var leadingInset: CGFloat = 53
public var eventGap: CGFloat = 0
public var eventGap: CGFloat = 2
public init() {}
}

Expand Down
28 changes: 14 additions & 14 deletions Sources/Timeline/TimelineView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,17 @@ public final class TimelineView: UIView {
super.draw(rect)

var hourToRemoveIndex = -1

if isToday {
let minute = component(component: .minute, from: currentTime)
let hour = component(component: .hour, from: currentTime)
// let minute = currentTime.minute
// if minute > 39 {
// hourToRemoveIndex = hour + 1
// } else if minute < 21 {
// hourToRemoveIndex = hour
// }
}
//
// if isToday {
// let minute = component(component: .minute, from: currentTime)
// let hour = component(component: .hour, from: currentTime)
//// let minute = currentTime.minute
//// if minute > 39 {
//// hourToRemoveIndex = hour + 1
//// } else if minute < 21 {
//// hourToRemoveIndex = hour
//// }
// }

let mutableParagraphStyle = NSParagraphStyle.default.mutableCopy() as! NSMutableParagraphStyle
mutableParagraphStyle.lineBreakMode = .byWordWrapping
Expand Down Expand Up @@ -301,7 +301,7 @@ public final class TimelineView: UIView {
width: 53, height: fontSize + 2)

var timeString = NSString(string: time)
print("timeString: \(timeString)")
// print("timeString: \(timeString)")
timeString = (time == "12:00") ? NSString(string: "12:00 PM") : NSString(string: time)

// print("test 0116 time: \(time)")
Expand Down Expand Up @@ -499,9 +499,9 @@ public final class TimelineView: UIView {
let eventView = eventViews[idx]
eventView.frame = attributes.frame

// let x: CGFloat = attributes.frame.minX
let x: CGFloat = attributes.frame.minX + 7

eventView.frame = CGRect(x: 60,
eventView.frame = CGRect(x: x,
y: attributes.frame.minY,
width: attributes.frame.width - style.eventGap,
height: attributes.frame.height - style.eventGap)
Expand Down

0 comments on commit fe6acfb

Please sign in to comment.