diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2011-10-27 10:46:21 +0400 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2011-10-27 10:46:21 +0400 |
commit | 8e1e17763f169f63dc99c7a0f109fe98c87b4064 (patch) | |
tree | 7be09d97cfecfa9b0158da2cf08675580b14f4e1 /app/helpers/snippets_helper.rb | |
parent | 117d1e90fdef3aaf64901ba18a5ce5bab4c668d8 (diff) |
implement snippets lifetime
Diffstat (limited to 'app/helpers/snippets_helper.rb')
-rw-r--r-- | app/helpers/snippets_helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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 |