Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 10:46:21 +0400
committerNihad Abbasov <narkoz.2008@gmail.com>2011-10-27 10:46:21 +0400
commit8e1e17763f169f63dc99c7a0f109fe98c87b4064 (patch)
tree7be09d97cfecfa9b0158da2cf08675580b14f4e1 /app/helpers/snippets_helper.rb
parent117d1e90fdef3aaf64901ba18a5ce5bab4c668d8 (diff)
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