Skip to content

Commit

Permalink
Using constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed Jul 10, 2021
1 parent f9f2bbd commit 5251b8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Clocker/Panel/ParentPanelController+ModernSlider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation

extension ParentPanelController: NSCollectionViewDataSource {
func collectionView(_: NSCollectionView, numberOfItemsInSection _: Int) -> Int {
return (96 * PanelConstants.modernSliderDaySupport * 2) + 1
return (PanelConstants.modernSliderPointsInADay * PanelConstants.modernSliderDaySupport * 2) + 1
}

func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
Expand Down Expand Up @@ -92,7 +92,7 @@ extension ParentPanelController {
}

public func setDefaultDateLabel(_ index: Int) -> Int {
let totalCount = (96 * PanelConstants.modernSliderDaySupport * 2) + 1
let totalCount = (PanelConstants.modernSliderPointsInADay * PanelConstants.modernSliderDaySupport * 2) + 1
let centerPoint = Int(ceil(Double(totalCount / 2)))
if index > (centerPoint + 1) {
let remainder = (index % (centerPoint + 1))
Expand Down
1 change: 1 addition & 0 deletions Clocker/Panel/ParentPanelController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ struct PanelConstants {
static let yesWithQuestionMark = "Yes?"
static let yesWithExclamation = "Yes!"
static let modernSliderDaySupport = 5
static let modernSliderPointsInADay = 96
}

class ParentPanelController: NSWindowController {
Expand Down

0 comments on commit 5251b8f

Please sign in to comment.