Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/GToolkit-Plotter/GtPlotterTimeEveryHour.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ Class {
#category : #'GToolkit-Plotter-Time'
}

{ #category : #'instance creation' }
GtPlotterTimeEveryHour >> durationsFrom: aStartDuration to: anEndDuration do: aBlock [
| aCounter aCeilStart aFloorEnd |

aCounter := 0.
aCeilStart := (aStartDuration / 1 hour) ceiling.
aFloorEnd := (anEndDuration / 1 hour) floor.

aCeilStart to: aFloorEnd do: [ :anAmountOfHourss |
aCounter % step = 0
ifTrue: [ aBlock value: (GtPlotterDuration hours: anAmountOfHourss) ].
aCounter := aCounter + 1 ]
]

{ #category : #'instance creation' }
GtPlotterTimeEveryHour >> from: aStartDateAndTime to: anEndDateAndTime do: aBlock [
| aCeilStart |
Expand Down