Skip to content

Commit

Permalink
Merge branch 'master' into prepend_i18n_load_path
Browse files Browse the repository at this point in the history
  • Loading branch information
pacso authored Oct 25, 2021
2 parents 6f37535 + 656c0c4 commit c64209f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: read-version
run: |
echo "::set-output name=VERSION::$(cat ./lib/ice_cube/version.rb | grep VERSION | awk '{ print $3 }' | sed -e 's/\"//g')"
- uses: actions/checkout@v2
- uses: dangoslen/[email protected]
echo "::set-output name=VERSION::`cat lib/ice_cube/version.rb | grep -i version | awk '{ print $3 }' | sed -e 's/\"//g'`"
- uses: dangoslen/[email protected]
with:
skipLabels: 'skip-changelog'
expectedLatestVersion: ${{ steps.read-version.outputs.VERSION }}
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Indonesian translations. ([#505](https://github.com/seejohnrun/ice_cube/pull/505)) by [@achmiral](https://github.com/achmiral)

### Fixed
- Fix for weekly interval results when requesting `occurrences_between` on a narrow range ([#487](https://github.com/seejohnrun/ice_cube/pull/487)) by [@jakebrady5](https://github.com/jakebrady5)

## [0.16.4] - 2021-10-21
### Added
- Italian translations
Expand Down Expand Up @@ -84,7 +87,7 @@ NOTE: the commit for the _v0.13.0_ release tag incorrectly says _Release 0.13.1_
- Fix whole-day skip with date inputs
- Missed times selected from gap week with weekly interval > 1 ([#241](https://github.com/seejohnrun/ice_cube/pull/241))
- Fix `occurs_on?` miss near midnight for DST ([#245](https://github.com/seejohnrun/ice_cube/pull/245))

## [0.12.1] - 2014-07-04
### Added
- Support for deserialization of times via Time.parse
Expand Down
6 changes: 2 additions & 4 deletions lib/ice_cube/validated_rule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ def other_interval_validations
# to the given start time
def next_time(time, start_time, closing_time)
@time = time
unless @start_time
@start_time = realign(time, start_time)
@time = @start_time if @time < @start_time
end
@start_time ||= realign(time, start_time)
@time = @start_time if @time < @start_time

return nil unless find_acceptable_time_before(closing_time)

Expand Down
13 changes: 13 additions & 0 deletions spec/examples/weekly_rule_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,19 @@ module IceCube
expect(schedule.next_occurrence(sample[2] - 1)).to eq(sample[2])
end

it "should respect weekly intervals within narrow occurrence ranges" do
start_time = Time.utc(2020, 10, 27, 7, 0, 0)
schedule = Schedule.new(start_time, end_time: start_time + ONE_HOUR)
occurrence_start = Time.utc(2020, 11, 5, 0, 0, 0)
occurrence_end = Time.utc(2020, 11, 5, 23, 59, 59)

schedule.add_recurrence_rule IceCube::Rule.weekly(2).day(:thursday).hour_of_day(13)
schedule.add_recurrence_rule IceCube::Rule.weekly(1).day(:thursday).hour_of_day(12)
expect(schedule.occurrences_between(occurrence_start, occurrence_end)).to eq([
Time.utc(2020, 11, 5, 12, 0, 0)
])
end

it "should align next_occurrence with first valid weekday when schedule starts on a Wednesday" do
t0 = Time.utc(2017, 6, 7)
schedule = IceCube::Schedule.new(t0)
Expand Down

0 comments on commit c64209f

Please sign in to comment.