summaryrefslogtreecommitdiff
path: root/app/helpers/snippets_helper.rb
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 11:46:21 +0500
committerNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 11:46:21 +0500
commit8e1e17763f169f63dc99c7a0f109fe98c87b4064 (patch)
tree7be09d97cfecfa9b0158da2cf08675580b14f4e1 /app/helpers/snippets_helper.rb
parent117d1e90fdef3aaf64901ba18a5ce5bab4c668d8 (diff)
downloadgitlab-ce-8e1e17763f169f63dc99c7a0f109fe98c87b4064.tar.gz
implement snippets lifetime
Diffstat (limited to 'app/helpers/snippets_helper.rb')
-rw-r--r--app/helpers/snippets_helper.rb9
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