Skip to content

Commit fded9a6

Browse files
authored
Merge pull request #4750 from jorgecoutinhobr/4743-extend-all-time-date-range-to-future
4743 extend all time date range to future
2 parents ea423bf + ac6f7d3 commit fded9a6

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

app/javascript/application.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ $(document).ready(function(){
9090
format: "MMMM D, YYYY",
9191
ranges: {
9292
customRanges: {
93-
'All Time': [today.minus({ 'years': 100}).toJSDate(), today.toJSDate()],
93+
'All Time': [today.minus({ 'years': 100 }).toJSDate(), today.plus({ 'years': 1 }).toJSDate()],
9494
'Today': [today.toJSDate(), today.toJSDate()],
9595
'Yesterday': [today.minus({'days': 1}).toJSDate(), today.minus({'days': 1}).toJSDate()],
9696
'Last 7 Days': [today.minus({'days': 6}).toJSDate(), today.toJSDate()],

spec/support/date_range_picker_shared_example.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ def date_range_picker_select_range(range_name)
2222
let!(:very_old) { create(described_class.to_s.underscore.to_sym, date_field.to_sym => Time.zone.local(2000, 7, 31), :organization => organization) }
2323
let!(:recent) { create(described_class.to_s.underscore.to_sym, date_field.to_sym => Time.zone.local(2019, 7, 24), :organization => organization) }
2424
let!(:today) { create(described_class.to_s.underscore.to_sym, date_field.to_sym => Time.zone.local(2019, 7, 31), :organization => organization) }
25+
let!(:one_year_ahead) { create(described_class.to_s.underscore.to_sym, date_field.to_sym => Time.zone.local(2020, 7, 31), :organization => organization) }
26+
let!(:two_years_ahead) { create(described_class.to_s.underscore.to_sym, date_field.to_sym => Time.zone.local(2021, 7, 31), :organization => organization) }
2527

2628
context "when choosing 'All Time'" do
2729
before do
@@ -36,10 +38,10 @@ def date_range_picker_select_range(range_name)
3638

3739
it "shows all the records" do
3840
visit subject
39-
date_range = "#{Time.zone.local(1919, 7, 1).to_formatted_s(:date_picker)} - #{Time.zone.local(2019, 7, 31).to_formatted_s(:date_picker)}"
41+
date_range = "#{Time.zone.local(1919, 7, 1).to_formatted_s(:date_picker)} - #{Time.zone.local(2020, 7, 31).to_formatted_s(:date_picker)}"
4042
fill_in "filters_date_range", with: date_range
4143
find(:id, 'filters_date_range').native.send_keys(:enter)
42-
expect(page).to have_css("table tbody tr", count: 3)
44+
expect(page).to have_css("table tbody tr", count: 4)
4345
end
4446
end
4547

0 commit comments

Comments
 (0)