diff --git a/Gemfile.lock b/Gemfile.lock index 66a46bdf..2d23c77d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -311,3 +311,6 @@ DEPENDENCIES timecop webmock zipruby + +BUNDLED WITH + 1.10.2 diff --git a/app_helpers.rb b/app_helpers.rb index 1952a520..b05f49a7 100644 --- a/app_helpers.rb +++ b/app_helpers.rb @@ -1,3 +1,13 @@ +def kickstarter_days_remaining + ending = Time.parse('Sat, Jul 25 2015 3:05 PM PDT') + today = Time.now + + remaining = ending - today + return 0 if remaining < 0 + + ((ending - today) / 86400).to_i +end + def dashboard_if_signed_in redirect '/dashboard' if signed_in? end diff --git a/views/home.erb b/views/home.erb index 048c23a4..910e740a 100644 --- a/views/home.erb +++ b/views/home.erb @@ -23,9 +23,9 @@
26 days left to get Neocities rewards and support our education goals! Learn More >>
+<%= kickstarter_days_remaining %> days left to get Neocities rewards and support our education goals! Learn More >>
We need your help to build an amazing HTML/CSS course into Neocities! Learn More >>