@@ -16,7 +16,7 @@ class FirstStepView: UIView {
1616
1717 weak var mapUpdater: MapUpdater?
1818
19− var chosenPoint: Int? = 0 {
19+ var chosenPoint: Int? {
2020 didSet {
2121 guard
2222 let periods = chosenPoint,
@@ -27,7 +27,7 @@ class FirstStepView: UIView {
2727 }
2828 }
2929
30− var fullDate: Date? = Date.getDateFromCurrent() {
30+ var fullDate: Date? {
3131 didSet {
3232 guard let date = fullDate, let _ = chosenPoint else { return }
3333
@@ -57,11 +57,10 @@ class FirstStepView: UIView {
5757 var bookingsForDates: [Date: [ReservationPeriod]] = [:] {
5858 didSet {
5959 guard
60− let date = fullDate?.getDMY(),
61− let reservPeriods = bookingsForDates[date]
60+ let date = fullDate?.getDMY()
6261 else { return }
6362
64− setUpBookingsForIntervals(reservations: reservPeriods)
63+ setUpBookingsForIntervals(reservations: bookingsForDates[date] ?? [])
6564 }
6665 }
6766
@@ -125,8 +124,9 @@ class FirstStepView: UIView {
125124 bookingsViewsForDate = []
126125
127126 for reservation in reservations {
128− let uiview = UIView(frame: CGRect(x: 0, y: 0, width: Constants.widthTimePoint * reservation.duration, height: 71))
129− uiview.backgroundColor = #colorLiteral(red: 0.2549019754, green: 0.2745098174, blue: 0.3019607961, alpha: 1)
127+ let uiview = UIView(frame: CGRect(x: 0, y: 0, width: Constants.widthTimePoint * reservation.duration, height: Constants.heightIntervals))
128+ uiview.backgroundColor = #colorLiteral(red: 0.8039215803, green: 0.8039215803, blue: 0.8039215803, alpha: 0.5)
129+
130130
131131 uiview.translatesAutoresizingMaskIntoConstraints = false
132132 scrollViewIntervals.addSubview(uiview)
@@ -135,11 +135,11 @@ class FirstStepView: UIView {
135135 let startDate = Date.getDateFromCurrent(days: date)!.set(hours: 12, minutes: 0, seconds: 0)!
136136
137137 NSLayoutConstraint.activate([
138− uiview.topAnchor.constraint(equalToSystemSpacingBelow: scrollViewIntervals.topAnchor, multiplier: 0),
139138 uiview.bottomAnchor.constraint(equalToSystemSpacingBelow: scrollViewIntervals.bottomAnchor, multiplier: 0),
140139 uiview.leftAnchor.constraint(equalTo: scrollViewIntervals.leftAnchor,
141140 constant: CGFloat(Constants.widthTimePoint / 2 + Constants.widthTimePoint * reservation.startTime.getMinutesPeriods(fromStart: startDate))),
142− uiview.widthAnchor.constraint(equalToConstant: CGFloat(Constants.widthTimePoint * reservation.duration))
141+ uiview.widthAnchor.constraint(equalToConstant: CGFloat(Constants.widthTimePoint * reservation.duration)),
142+ uiview.heightAnchor.constraint(equalToConstant: CGFloat(Constants.heightIntervals))
143143 ])
144144
145145 bookingsViewsForDate.append(uiview)
@@ -247,5 +247,6 @@ extension FirstStepView {
247247 static let daysCount = 14
248248 static let widthTimePoint = 11
249249 static let widthDate = 31
250+ static let heightIntervals = 70
250251 }
251252}