From 8e1e17763f169f63dc99c7a0f109fe98c87b4064 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Thu, 27 Oct 2011 11:46:21 +0500 Subject: implement snippets lifetime --- app/helpers/snippets_helper.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/helpers/snippets_helper.rb') diff --git a/app/helpers/snippets_helper.rb b/app/helpers/snippets_helper.rb index 236b6c8c23a..cd7b03593c8 100644 --- a/app/helpers/snippets_helper.rb +++ b/app/helpers/snippets_helper.rb @@ -1,2 +1,11 @@ module SnippetsHelper + def snippet_lifetime_select_options + options = [ + ['forever', nil], + ['1 day', Date.strptime("#{Date.current.day}.#{Date.current.month}.#{Date.current.year}", "%d.%m.%Y") + 1.day], + ['1 week', Date.strptime("#{Date.current.day}.#{Date.current.month}.#{Date.current.year}", "%d.%m.%Y") + 1.week], + ['1 month', Date.strptime("#{Date.current.day}.#{Date.current.month}.#{Date.current.year}", "%d.%m.%Y") + 1.month] + ] + options_for_select(options) + end end -- cgit v1.2.1