Skip to content

Commit f64bc4c

Browse files
Update date range in application.js and date_range_picker_shared_example.rb
1 parent 558e28a commit f64bc4c

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ 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) }
2526

2627
context "when choosing 'All Time'" do
2728
before do
@@ -36,10 +37,10 @@ def date_range_picker_select_range(range_name)
3637

3738
it "shows all the records" do
3839
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)}"
40+
date_range = "#{Time.zone.local(1919, 7, 1).to_formatted_s(:date_picker)} - #{Time.zone.local(2020, 7, 31).to_formatted_s(:date_picker)}"
4041
fill_in "filters_date_range", with: date_range
4142
find(:id, 'filters_date_range').native.send_keys(:enter)
42-
expect(page).to have_css("table tbody tr", count: 3)
43+
expect(page).to have_css("table tbody tr", count: 4)
4344
end
4445
end
4546

0 commit comments

Comments
 (0)